import { Directive , Input , OnInit , OnDestroy } from '@angular/core' ; import { HelpCenterService , HelpCenterItem } from './help-center.service' ; @ Directive ( { selector : '[uxHelpCenterItem]' } ) export class HelpCenterItemDirective implements OnInit , OnDestroy { @ Input ( ) uxHelpCenterItem : HelpCenterItem ; constructor ( private _helpCenterService ) { } ngOnInit ( ) { this . _helpCenterService . registerItem ( this . uxHelpCenterItem ) ; } ngOnDestroy ( ) { this . _helpCenterService . unregisterItem ( this . uxHelpCenterItem ) ; } }