> Always have a ‘.’ in your ng-models which insures prototypal inheritance.
That isn't what that does. The egghead.io Angular videos also get this wrong. I really think that the vast majority of Angular programmers don't really understand how its scoping works. I've ranted about this before [1], it's just ridiculously complex.
Some scopes inherit prototypically from their parents, and others don't, and you can't tell or affect it from the markup. The dot just means you're referring to a property of an object on the scope. If the object is somewhere in the scope inheritance chain, two directives attached at different points in that chain can share data by pointing to the object. If the object isn't there, what the name points to is actually non-deterministic. Ng-model silently creates it, and the point in the chain at which it creates it depends on which directive wanted to write to the property, which might depend on the order in which the user interacts with the different elements on the page.
[1]: http://larseidnes.com/2014/11/05/angularjs-the-bad-parts/
Anything that makes programmers productive is a great tool. Angular 1.x definitely makes teams productive. It's one of the first web framework that comes with a specific testing framework. The clear separation between the DOM and the business logic makes apps more testable. And I could go for hours. Angular helps developers write complex apps faster and better.
Sure it isn't perfect, but show me something better with all the features AngularJs has.
AngularJS didn't became popular because it was from Google, a simple proof is the closure widget library nobody uses outside google. AngularJS became popular because it was obviously superior in term of developer experience.
Now your point about ng-model and scopes is valid.But it's not a angular problem, it's a javascript issue.Ultimately to understand angular you need to understand how javascript works, which many develpers don't.
Instead of saying "this thing is bad", Educate them. But I guess sensationalism drives more clicks.
Any 'sensationalism' comes from legitimate anger with the framework, after having spent over a year working with it on a large project.
> Now your point about ng-model and scopes is valid.But it's not a angular problem, it's a javascript issue.
This I don't agree with. Yes, JavaScript has prototypical inheritance between objects, but certainly not between scopes. It has lexical scoping like everyone else. The decision to have scopes be objects that (sometimes, not always) inherit from one another, is entirely on Angular. So is the decision to have ng-model silently create objects on this scope.
Definately? Based on what? The teams i've seen and projects i've been on that use Angular take much longer and end up with slow, buggier code.
>Sure it isn't perfect, but show me something better with all the features AngularJs has.
Meteor, Ember, React, Qooxdoo, Extjs, Backbone, etc... pretty much every other framework. Most of them don't specify a half-baked programming language hiding in data attributes in your dom-nodes.
>AngularJS became popular because it was obviously superior in term of developer experience
That is a lie. Angular seems to attract back-end programmers who have been moved to the front-end because it uses design patterns that are more common to back-end development. Find me a single Angular fan, that has actual job experience with at least two other SPA frameworks.
>Instead of saying "this thing is bad", Educate them. But I guess sensationalism drives more clicks.
You are misrepresenting his blog post, mostly out of spite.
Here's a more generic complaint: doing control-flow by annotating dom-nodes dom just means you lose proper debugging, refactoring, scoping and not to forget: hurts performance (since dom reads are much too expensive).
Angular is one of the worst executions of a fundamentally flawed approach. The only people defending it are those who are not familiar with _any other alternative_.
Where on earth did you get that idea?
> AngularJS didn't became popular because it was from Google
But it was definitely helped that it was so heavily promoted by Google
> your point about ng-model and scopes is valid. But it's not a angular problem, it's a javascript issue
Again...what? JavaScript doesn't have `ng-model`...Angular does. It's an Angular problem through and through.
It's got some good information on some pieces of angular that more people should have a better understanding of, yes. However, trying to absorb that information through the shouting and sensational ranting is almost impossible.
This same article could have been written by a level-headed coder who understands the complexity of making a widely distributed browser frameworks and it would have been called "5 Angular Idiosyncrasies" or "Tricky Angular Patterns".
But no, sensationalism sells and loud, strident claims win the day. Why have humility and get less clicks when you can write a scathing takedown using strawman arguments and style yourself the next Crockford?
Your points are entirely valid criticisms, but your language and attitude make you sound like a blowhard trying to prove something or a shill promoting a competing framework with negative press.
The tone comes from being legitimately angry at these flaws in Angular, but also from having to discover them myself, instead of reading about them on someone else's blog. The various JavaScript frameworks affect hundreds of thousands of developers every day, and choosing the wrong one can cost companies a lot of money. I really think that as a profession we'd make progress faster if more people wrote angry blog posts about things that are bad.
I suspect Google would gain a huge amount of goodwill if they backed down and announced: "You know, we'll rename the incompatible redesign as AngularNext 0.1 and use it to develop cutting-edge ideas. Then we'll bring the best of those into the mainstream Angular over time without breaking compatibility."
They could call the rebooted compatible Angular 2.0 "Harmony".
FWIW, Angular 2 is awesome to work with, even in its alpha form. Productivity with it should be immensely improved compared to 1.x.
The ones for emacs/vim are 1 page only, I guess we have a measure of the complication of angular now.
> The ones for emacs/vim are 1 page only,
Apples and Oranges
> I guess we have a measure of the complication of angular now.
AngularJS isn't rocket science. But maybe we don't have the same definition complexity , which makes sense if you are a skiddie.
Btw, I use kate that need NO cheatsheets, because mastering an editor does not make me a better coder...
EDIT: ok I also use vim, emacs, joe, nano, ultraedit, gedit, visualstudio, netbeans, eclipse, nvi, simpletext, texmate, sublime ... whatever the guy paying me want me to use even if it is stupid.
I've always been very against these angular versions of basic js functions because it requires everyone on the team to learn them and it puts you even deeper into the angular lock in swamp, hindering you from eventually changing your view-framework in the future. Any takes on this?
I like the data binding of angular but try to restrict angular coming in contact with "core" code. As example we hardly write any services, we just use them to hold an instance of plain js-classes that can easily be reused in non angular projects.
It's no problem to call $timeout in your Controller code or whatever, but what if you want to require a module that uses `setTimeout`? Either the module has to have some way of passing in the timeout function it should call, or you'd have to have a shim that monkey patches it or something.
The APIs look identical, some with a little added functionality - but the primary reason for the AngularJS wrappers is that they'll automatically call $scope.$apply() for you, so that you don't have to do it yourself.
Nice cheat sheet though!