5 ms·
The 1.x injector is not a very difficult pattern to understand, so if you're working with Angular you should pick up on it quickly. However, for production app
by caitp 13y ago
The 1.x injector is not a very difficult pattern to understand, so if you're working with Angular you should pick up on it quickly.
However, for production apps, you're probably not using "magic" function annotation, at least not without the help of ngmin or a similar tool.
It's just a nice way to quickly write demonstrations and explain code. Arguably, the explicit annotations would not really inform you any better than implicit annotation, if you were unfamiliar with the framework.
So, I agree that explicit annotation is important, but I think the "magic" annotation also makes the framework a bit more accessible to new comers, and is also very handy for producing small demos, reproductions, or other small apps. The fact that we can offer the choice here is great.
A little bit of experience with the framework and all this stuff becomes pretty much second nature. I expect Ember or Knockout would be similar in that regard.
Basically, 1) understand the fundamentals of your framework. 2) use the right tools/methods for the right job. You can certainly write maintainable and understandable apps using all of the annotation styles.
At least, in my opinion.