When I try to validate a page made with AngularJS, I find that it does not correctly validate and throws numerous errors in the code (it is usually the same repeated). The problem is that the attributes ng-
are not considered standard and generate the failure.
For example, this simple code in AngularJS:
<!DOCTYPE html>
<html>
<head>
<title>Test con Angular</title>
<script src="angular.js"></script>
</head>
<body ng-app ng-init="nombre='Juan'; apellido='Tanamera';">
<strong>Nombre:</strong> {{nombre}}<br />
<strong>Apellido:</strong> <span ng-bind="apellido"></span>
</body>
</html>
When I pass it through the W3C code validator , it throws me the following error:
Error: Attribute
ng-app
not allowed on elementbody
at this point.From line 8, column 1; to line 8, column 61
↩</head>↩↩<body ng-app ng-init="firstName = 'John'; lastName = 'Doe';">↩ <st
And now the questions:
- Should I worry about not validating the code?
- Is there a way to change it so that the validator does pass?