r/programming • • Mar 18 '14

AngularJS 2.0

http://blog.angularjs.org/2014/03/angular-20.html
213 Upvotes

71 comments sorted by

View all comments

5

u/nerfornothing1138 Mar 18 '14

Anyone else not a fan of implementing logic into attributes of HTML elements?

20

u/billybolero Mar 18 '14

As opposed to binding them in Javascript and A) have no clue of which elements have what behaviour when looking at the HTML and B) having your designer unknowingly break things by moving things around or renaming class names?

2

u/nerfornothing1138 Mar 18 '14

B, but using templates help negate this potential pitfall by separating your site into widgets or reusable components.

0

u/[deleted] Mar 18 '14

[deleted]

3

u/nerfornothing1138 Mar 18 '14

OK, but it's still coupling at its most basic level. For instance, what if, part-way through the project you wanted to move to Backbone or a server-side solution? All of your HTML now has core app logic in it.

It's the sort of stuff we made fun of classic ASP and PHP for over a decade ago.

1

u/DecoLabels Mar 19 '14

If your HTML has core app logic in it, you're not using Angular very well. The HTML should be a simple view. Any serious logic should be somewhere more sensible, like your model, or a service.