Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-app is not valid attribute of element 'HTML'

Tags:

angularjs

I am new to angularJs and while I am using ng-app and ng-view in HTML file, it is saying these are not valid attributes of element in HTML

Can any one suggest

Here is sample code:

<html **ng-app**= "XXXXX" xmlns="http://www.w3.org/1999/xhtml">
    <head>
    </head>
    <body>
        <div **ng-view**></div>
    </body>
</html>
like image 868
RahulRavipati Avatar asked Apr 26 '13 19:04

RahulRavipati


2 Answers

I assume this is just a warning, in which case you can just ignore it. If you are using a recent version of AngularJS and you are targeting HTML5, you can prepend data- to the attribute name (e.g. data-ng-app) and the warning should go away.

like image 122
Daniel Pratt Avatar answered Nov 09 '22 22:11

Daniel Pratt


I guess this is simple fix by adding "data-" for every ang-js directive

incase if you are using netbeans as editor,

https://netbeans.org/bugzilla/show_bug.cgi?id=224637

like image 4
User_allowed Avatar answered Nov 09 '22 20:11

User_allowed