3 ms·
Well, there's a good reason why $scope and controllers will disappear with Angular 2.0. $scope is convenient, but also a massive source of problems. There's wor
by mcv 12y ago
Well, there's a good reason why $scope and controllers will disappear with Angular 2.0. $scope is convenient, but also a massive source of problems. There's workarounds for those problems, but those workarounds wouldn't even be necessary if this aspect of Angular had been designed better.
Angular has some great stuff, and some really necessary ideas and principles that were sorely needed in Javascript. I love working with it, most of the time. But it also has some serious design errors.
- Bahamut 12y agoI think anyone who knows Angular well would agree - it's a joy to work with, but it isn't perfect. Angular 2.0 is a step in the right direction in many ways. This blog post is pretty horrid though. I find myself moving more of my code into pure JS & borrowing concepts from languages like Java (interfaces, abstract classes, etc.) to increase agility in the event I want to move towards using a different library/framework. I gave a talk related to this idea of a frontend SOA about a week ago - here are the slides: http://slides.com/wesleycho/soa-angular http://slides.com/wesleycho/soa-angular
- tericho 12y agoThis is anecdotal, but I once found this incredible use of $scope while viewing the source for a sports page: https://gist.github.com/tcrosen/96279e39f9b0fb85c266 https://gist.github.com/tcrosen/96279e39f9b0fb85c266
- magikid 12y agoI just started learning Angular and that code smells. Why wouldn't you make some sort of object for all of those and assign the object to scope?