Eckige 2 - wie Sie access-Richtlinie und der Aufruf einer member-Funktion in es

Habe ich eine Richtlinie wie diese -

@Directive({
    selector:   'someDirective'
})
export class  SomeDirective{         
    constructor() {}    
    render = function() {}
}

und dann bin ich den Import der Richtlinie

import {SomeDirective} from '../../someDirective';
@Page({
    templateUrl: '....tem.html',
    directives: [SomeDirective]
})
export class SomeComponent {
      constructor(){}
      ngAfterViewInit(){//want to call the render function in the directive
}

In ngAfterViewInit, möchte ich nennen, die render-Funktion in der Richtlinie.
Wie Sie dies tun ?

InformationsquelleAutor VISHAL DAGA | 2016-03-22
Schreibe einen Kommentar