Because XUL is XML, AngularJS syntax must be an XML compatible version:
add id="ng-app"
to the root element in combination with the ng-app
attribute
<!doctype html> <html xmlns:ng="urn:ng" id="ng-app" ng:app="optionalModuleName"> <div my-directive="exp"></div> ... </html>
Use custom element tags such as <ng:view>
To make CSS selectors work with custom elements, the name of the custom element must be pre-created using document.createElement ('my-tag') regardless of the XML namespace.
<html xmlns:ng="urn:ng"> <head> <style> ng\:view { display: block; border: 1px solid red; } ng\:include { display: block; border: 1px solid blue; } </style> </head> <body> <ng:view></ng:view> <ng:include></ng:include> ... </body> </html>
The compiler now transparently supports several directive syntaxes. For example, so far there was only one way to use the ng: include directive :. The new compiler treats all of the following as equivalent:
<ng:include src="someSrc"></ng:include> <div ng:include src="someSrc"></div> <div ng:include="someSrc"></div> <div data-ng-include src="someSrc"></div> <div data-ng-include="someSrc"></div> <ng-include src="someSrc"></ng-include> <div ng-include src="someSrc"></div> <div ng-include="someSrc"></div> <x-ng-include src="someSrc"></x-ng-include> <div class="ng-include: someSrc"></div>
This will give template developers more flexibility to consider the trade-offs between the reliability of the HTML code and the multiplicity of the code and choose the syntax that works best for them.
References
source share