If I have a simple button with a click handler and a custom attribute directive like so:
<button (click)="save()" attributedirective="project saved">Save</button>
And in my attribute directive I'm using the hostlistener decorator to listen to the click event:
@Directive({
selector: `[attributedirective]`
})
export class AuditPusher {
@Input('attributedirective') attributedirective: string = 'Missing message!';
@HostListener('click', ['$event'])
pushAudit() {
console.log('text:'+this.attributedirective.toString());
}
}
Which of my code will fire first? The save() on the click event or the code in my attribute directive? - And: Imagine having two attribute directives. Which of those will fire first? In Angular 1 there was something like directive priorities, how is this done in Angular 2? I find it difficult to find documentation on this.