5 ms·
polluting HTML with.. HTML attributes? Angular lets you stay very much in line with the spirit of HTML, which is a declarative language. To me, when done right,
by marknutter 14y ago
polluting HTML with.. HTML attributes? Angular lets you stay very much in line with the spirit of HTML, which is a declarative language. To me, when done right, an angular infused HTML page reads very nicely. It's clear to the designer what elements do what. All that logic isn't hidden away in some javascript file.
The fact that you do very little DOM manipulation with angular.js is one of its biggest advantages, IMO. Makes it easier to write maintainable and testable code.
- joshontheweb 14y agong attributes are invalid html attributes. Any non-standard attr should be prefaced by 'data-' according to the spec. edit: Also to you point about dom manipulation. The same amount of dom manipulation is happening. You just aren't in control of it.
- OriginalSyn 14y agoBTW Angular supports prefixing your 'ng-' attributes with 'data-' if you want valid HTML.
- joshontheweb 14y agoDidn't know that. Makes it a little better ;)
- defen 14y agoAngular lets you use attributes like: data-ng-*. You can also put directives in css if are that concerned about validating markup - class="data-ng-click: foo"