Angular2 component loading external js lib file

Viewed 525

I have a component that uses a javascript library. At the moment I am just using system.js to load the dependency

public ngOnInit() {
    System.import('lib').then(() => this.createControl());
}

However this delay in the initialization of the component is causing an issue with another, consuming component. Essentially the createControl function is running too late.

Is it possible to delay initialization of the entire component with angular until all dependencies are downloaded?

1 Answers
Related