import { Injectable } from '@angular/core' ; import { AbstractEventPlugin } from './abstract.plugin' ; @ Injectable ( ) export class OptionsEventPlugin extends AbstractEventPlugin { protected readonly modifier = 'capture.once.passive' ; supports ( event ) { return event . includes ( '.' ) && ! this . unwrap ( event ) . includes ( '.' ) ; } addEventListener ( element , event , handler ) { element . addEventListener ( this . unwrap ( event ) , handler , { once : event . includes ( '.once' ) , passive : event . includes ( '.passive' ) , capture : event . includes ( '.capture' ) , } ) ; return ( ) => element . removeEventListener ( this . unwrap ( event ) , handler ) ; } }