ng-app vs. data-ng-app, what is the difference?

Good question. The difference is simple – there is absolutely no difference between the two except that certain HTML5 validators will throw an error on a property like ng-app, but they don’t throw an error for anything prefixed with data-, like data-ng-app.

So to answer your question, use data-ng-app if you would like validating your HTML to be a bit easier.

Fun fact: You can also use x-ng-app to the same effect.

Leave a Comment