Difference between revisions of "AngularJS template"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Created page with "In AngularJS, a '''template''' provides HTML. == See also == * AngularJS * AngularJS component * AngularJS directive * JavaScript library * Web applica...")
 
 
Line 1: Line 1:
In [[AngularJS]], a '''template''' provides HTML.
+
In [[AngularJS]], a '''template''' is HTML which tells AngularJS how to render a component.
 +
 
 +
Templates include data bindings as well as other components and directives.
 +
 
 +
Angular 2 leverages native DOM events and properties.
 +
 
 +
Angular 2 leverages shadow DOM, helps with view encapsulation (e.g. styles applied to component).
 +
 
 +
Best practice:  put template in component [[AngularJS metadata|metadata]].
  
 
== See also ==
 
== See also ==

Latest revision as of 14:12, 31 December 2016

In AngularJS, a template is HTML which tells AngularJS how to render a component.

Templates include data bindings as well as other components and directives.

Angular 2 leverages native DOM events and properties.

Angular 2 leverages shadow DOM, helps with view encapsulation (e.g. styles applied to component).

Best practice: put template in component metadata.

See also