I have a line of code in a HTML file that looks like this
<button class="btn btn-primary" data-ng-click="ok()">Create PDF</button>
My question is this. Isn't this an example of going back to using obtrusive Javascript?
Is there a better way to do this?
Yes it is. But I don't think it's a bad thing.
I think Angular is great because you can look at the markup and you can figure out what is going on whereas if using JQuery you have no idea what is going to happen unless you look at the JavaScript.
You can use ng-if, ng-repeat, ng-show, ng-class, etc... it's a great framework to use.
You can drop ids in elements completely and abstract away large amounts of html into directives which can be reused across your application.
It results in less html in my experience because of the directives [ng-repeat + custom directives]
Hope this helps.