Tuesday 21 November 2017

When to use data-ng and When to use ng in AngularJS.

In this article, We will discuss When to use data-ng and When to use only ng in Angular JS.

Well, We can Use either data-ng or ng. There Will be no error generate When we use either data-ng or ng but sometimes it will Show Warning.

When we use ng and if HTML is not used in that page then it will Show Warning like "Validation(HTML5):Attribute 'ng-app' is not a valid attribute of element 'body'". 

But to resolve this Warning we need to add data befor ng like this, data-ng in AngularJS.

So due to avoid those Warnings it is recommended to Use data-ng but Still We can Use ng also.

0 comments:

Post a Comment