import { Injectable } from '@angular/core' ; import { AbstractEventPlugin } from './abstract.plugin' ; @ Injectable ( ) export class SelfEventPlugin extends AbstractEventPlugin { protected readonly modifier = '.self' ; addEventListener ( element , event , handler ) { const wrapped = ( event ) => { if ( event . target === event . currentTarget ) { handler ( event ) ; } } ; return this . manager . addEventListener ( element , this . unwrap ( event ) , wrapped ) ; } }