Templates are markup which is added to HTML to declaratively describe how the application model should be projected to DOM as well as which DOM events should invoke which methods on the controller.
- Binding events allows wiring events from DOM (or other components) to the Angular controller.
- Angular listens to bubbled DOM events (as in the case of clicking on any child), as shown below:
In the above example, when clicking on the submit button angular will invoke the method on the surrounding component’s controller.
- NOTE: Unlike Angular v1, Angular v2 treats event bindings as core constructs not as directives.
- This makes it possible for Angular v2 to easily bind to custom events of Custom Elements, whose event names are not known ahead of time.
- Property bindings are the only data bindings which Angular supports, but for convenience Angular supports an interpolation syntax which is just a short hand for the data binding syntax.