5 ms·
3/5 of the main points listed in the conclusion of the study centered around directives, summed up in one of the points: "although the creation of custom direc
by 6DM 10y ago
3/5 of the main points listed in the conclusion of the study centered around directives, summed up in one of the points:
"although the creation of custom directives is one of the most appreciated characteristics of ANGULARJS, the API that supports this feature is perceived as complex to use and understand by developers"
I just started using AngularJS 1.5 at my new job, coming from react, I actually started a list of problems I encountered. Basically everything stemmed from how complicated it get's working with directives and properly scoping/binding where you want.
I don't know if Angular 2 will face these same issues, they still have directives, but I don't know if they're exactly the same. I "heard" that Angular 2 was supposed to jump on the unidirection binding bandwagon. This stackoverflow Q&A seem to indicate it's still two way binding. http://stackoverflow.com/questions/35469024/how-does-angular-2-change-detection-work http://stackoverflow.com/questions/35469024/how-does-angular...
Anybody know if it's any better?
- SomeCollegeBro 10y agoAngular2 directives now have the concept of Inputs and Outputs for data flowing through them. It's a much better design than angular.js in my opinion. https://angular.io/docs/ts/latest/cookbook/component-communication.html https://angular.io/docs/ts/latest/cookbook/component-communi...
- ben_jones 10y agoBeen 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.
- dcherman 10y agoYou can embrace unidirectional flow in Angular 1.X as well even if it's not enforced by the framework. I'd actually recommend it as it makes things so much easier to reason about, but I'll admit that it can be quite verbose, especially without the syntactic sugar that Angular2 provides.