3 ms·
Funny you mentioned routing, that was something I started off with trying to implement first. The existing application didn't have it. So trying to leverage Ang
by 6DM 10y ago
Funny you mentioned routing, that was something I started off with trying to implement first. The existing application didn't have it. So trying to leverage Angular in an appropriate way I wanted to turn on routing for some of the links and slowly fix up the old pages.
I eventually figured that there is no backward compatibility, it's all or nothing. So what I had to do was come up with a little hack to check the URL myself and if it was a configured route enable it. :/
Do you know if the new routing module in 2 will support old links like in my case? I took a quick skim, no mention.
- ben_jones 10y agoWell Angular 1.x had the ui-router library which basically overhauled the default 1.x routing and added all sorts of nice features through a relatively clean API. Angular 2.x has tried to fix this divergence by incorporating much of that API, but they didn't get it quite right the first time so they're still working on it (IMO). I don't know exactly what you mean by "routing module that supports old links". Are you referring to the "LocationStrategy" which differentiates between routes such as /#/some-state vs. /some-state (with <base href="/">)?. Or are you moving a non-SPA application to a SPA application w/angular routing?
- 6DM 10y agoI think it will be clearer with an example. So we have an application with a left menu and several links in it, here's an example list: /Dashboard/WorkLoad /Accounts/AllPeople /Automotive/CarGallery I want to add a few new pages, "/Dashboard/Monitoring", "/Dashboard/Logs". I want this to utilize angular with html5mode enabled. This way they can still bookmark the links and come back, or at least the url won't look weird. I don't want the old links to be broken, as I add pages with routing enabled it should work. It ends up breaking though because if those other three links don't match my two configured links (Monitoring, Logs), it uses "otherwise" to fallback to the home directory "/". There's no way arround this other than detecting and turning on/off the routing.