Just started with my first angularjs project for learning. Try to make more angular as it can be so I can learn something:). I was expecting great OOP library like YUI 3 but what I see is lots of features that can be done outside of code if you prefer that approach to work. On the other side if you like to get dirty with code, its more of hacking and be inside scope of framework (with $scope) rather to follow OOP.
Looks to me like of bunch procedural coding with enforcing OOP through $scope. Its great for building frontend interface, lots of boring task are done inside of framework, eats JQuery development for breakfast, but on other hand lacks something that you can see in YUI3 or forgotten Prototype. My first OOP problem. I create directive that use as simple purpose, now I need to create another directive that uses different view in part and share some abstract code. Its doing same thing but on more complex way. Examples on web is to hack it through framework, not just to have $extend or to doit with abstract. Even we cant enforce abstract method for directive. Other problem, translation, how to implement it. To create method outside framework looks good. Well lets not to be outside framework, you have to global scope it. Then you found arguments its not good approach to global scope function, but how else to doit. Lets go with OOP approach, you will create abstract controller, and create getter for translation function. You can call it everywhere, not to break application configuration or controllers. In current way your global scope breaks OOP, breaks encapsulation. Its just me or angular is missing one of basic OOP principals. inheritance between objects, then encapsulation. And it ends this brings down third principal, polymorphism. There is no OOP in Angularjs? -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
