import { ElementRef , Renderer2 , Directive , AfterViewInit , Input , OnDestroy , ViewContainerRef } from "@angular/core" ; import { BaseDirective } from "./base.directive" ; import { TextDirective } from "@rxweb/localization" ; @ Directive ( { selector : '[rxText]' , } ) export class RxTextDirective extends BaseDirective implements AfterViewInit , OnDestroy { @ Input ( 'rxText' ) name : string ; @ Input ( ) text : string ; constructor ( renderer , elementRef , viewContainerRef ) { super ( renderer , elementRef , viewContainerRef ) ; } private textDirective : TextDirective ; ngAfterViewInit ( ) { this . textDirective = new TextDirective ( { element : this . element , name : this . name , target : this . component , text : this . text } ) ; this . textDirective . bind ( ) ; } ngOnDestroy ( ) { this . textDirective . destroy ( ) ; } }