import { Directive , ElementRef , Renderer } from '@angular/core' ; @ Directive ( { selector : '[plugin]' } ) export class TNSYourPluginDirective { constructor ( private el , private renderer ) { renderer . setElementAttribute ( el . nativeElement , 'class' , 'sample-class' ) ; } }