Je suis nouveau dans Angular 2. J'ai injecté une directive dans le composant actuel.
@Component({
selector: 'select-me',
templateUrl: 'app/template.html',
directives: [BackgroundChange] // I want to access this same instance to make the dynamic changes
})
export class PageComponent {
constructor(private backgroundChange:BackgroundChange) {
// I guess this will create new instance of BackgroundChange
}
}
Je veux appeler les méthodes disponibles dans BackgroundChange pour effectuer certains changements de manière dynamique à partir du composant Page.