3 ms·
Been an angular dev for a few years and recently did a 1-2 transition. The API got a lot cleaner and the docs are pretty good. There is still a learning curve a
by ben_jones 10y ago
Been an angular dev for a few years and recently did a 1-2 transition. The API got a lot cleaner and the docs are pretty good. There is still a learning curve and (IMO) a lack of learning resources for anything beyond a simple demo application. Questions like "how do I get the name of the name of the currently activated route?" was one I recently was unable to answer and had to implement a different solution for then in 1.x.
I think angular will suffer from a trickle effect as developers migrate slowly over the course of years from 1.x to 2.x. There is no impetus currently to create advanced learning resources as everybody seems to pretty much be learning at their own rate.
That said I will be implementing future SPA applications using Angular 2 because it offers a very clear value proposition to me and has more great features coming within the next ~6 months, such as server-side rendering iirc.
Edit: To clarify my troubles with finding the activated route name stemmed from a rapidly changing Router API in angular 2. Apparently it's going to be easy in the final version (3.0) but there is no current solution for it apparently. Other then that I really like the new router.
- 6DM 10y agoFunny 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.