Re:Opinionated Comparison of React, Angular2, and Aurelia
by Matthias247 on Friday April 07, 2017 @02:37AM
(#14057629)
Regarding the Angular DI part: You don't need "provides" anymore on each component, afaik it's even deprecated. You just need to define it once on the module that defines the DI providers. And in the module of the component import that module. But your findings may already have been from some time ago where things were different in Angular land. That's for me the saddest story of Angular 2: Between alpha, beta, RC and final release dozens of things changed, which required me to constantly change my app. Now that it's stable I'm quite sophisticated with it.
[ Parent
| on HN ]
Re:Opinionated Comparison of React, Angular2, and Aurelia
by SebastianM on Friday April 07, 2017 @03:21AM
(#14057790)
> afaik it's even deprecated.
No, it's not. You use providers on a component when you want to have a new instance of that Service when a new Component instance of that type gets created. So you have complete control over the DI. More details here: https://angular.io/docs/ts/latest/guide/dependency-injection...