Check out the plunker link for testing purposes.
@Component({
selector: 'test-app'
template:`
<h1>AngularJs 2 Material Design Demo</h1>
<md-input-container>
<label>Your name</label>
<input #newname />
</md-input-container>
<p (click)="test()" (focus)="test2()">
Hello, {{newname.value}}
</p>
`,
directives: [MdInputContainer, MdInput]
})
class TestApp {
constructor(){
this.title = 'AngularJs 2 Material Design Demo';
}
test() {
console.log('test');
}
test2() {
console.log('test2');
}
}
The provided example showcases the addition of (click)
and (focus)
to the <p>
element.
<p (click)="test()" (focus)="test2()">
However, it appears that only the click
event is being processed, while the focus
event seems to be disregarded. Is there a flaw in my usage of the focus event?
Your input and guidance are valuable.
Thank you