feat(view): adds event binding to view instantiation.
Only native non-bubbling events are supported by the commit.
This commit is contained in:
@ -20,7 +20,8 @@ import {bootstrap, Component, Decorator, TemplateConfig, NgElement} from 'core/c
|
||||
// The template for the component.
|
||||
// Expressions in the template (like {{greeting}}) are evaluated in the
|
||||
// context of the HelloCmp class below.
|
||||
inline: `{{greeting}} <span red>world</span>!`,
|
||||
inline: `<div>{{greeting}} <span red>world</span>!</div>
|
||||
<button (click)="changeGreeting()">change greeting</button>`,
|
||||
// All directives used in the template need to be specified. This allows for
|
||||
// modularity (RedDec can only be used in this template)
|
||||
// and better tooling (the template can be invalidated if the attribute is
|
||||
@ -33,6 +34,9 @@ class HelloCmp {
|
||||
constructor(service: GreetingService) {
|
||||
this.greeting = service.greeting;
|
||||
}
|
||||
changeGreeting() {
|
||||
this.greeting = 'howdy';
|
||||
}
|
||||
}
|
||||
|
||||
// Decorators are light-weight. They don't allow for templates, or new
|
||||
|
Reference in New Issue
Block a user