I read on W3C School that to make a valid HTML page I have to add
data before each angular directive in HTML file (e.g.:
<p>The name is <span data-ng-bind="firstName"></span></p>
<div data-ng-app="" data-ng-init="firstName='John'">
Ok that's fine. I have two questions:
- Should this prefix be used only for
- Could this
data- prefix create problems with Angular third-party libraries?
Best How To :
data- prefix can be used by any directive and the underlying directive name normalization process takes care of matching the directive attribute declaration with the directive implementation.
More details about the normalization process is available in the directive user guide under section "Matching Directives".
data- prefix to to any directive does not affect any third party directives.