How to use the angular2-universal.buildNodeAppProviders function in angular2-universal

To help you get started, we’ve selected a few angular2-universal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github barbatus / angular2-meteor-universal / build / bootloader.js View on Github external
Bootloader.prototype.bootstrap = function (component, providers, options) {
        var doc = this.createDoc(component);
        var customProviders = angular2_universal_1.buildNodeAppProviders(doc, this.getAppProviders(options));
        customProviders = lang_1.isPresent(providers) ? providers.concat(customProviders)
            : customProviders;
        var bootstrapping = angular2_meteor_1.MeteorApp.bootstrap(component, angular2_universal_1.buildNodeProviders(), customProviders);
        return bootstrapping.then(function (compRef) { return ({
            appRef: compRef.injector.get(core_1.ApplicationRef),
            compRef: compRef
        }); });
    };
    Bootloader.prototype.createDoc = function (component) {
github barbatus / angular2-meteor-universal / modules / bootloader.ts View on Github external
private bootstrap(component: Type,
                    providers: Providers,
                    options: ServerOptions) {
    let doc = this.createDoc(component);
    let customProviders = buildNodeAppProviders(doc, this.getAppProviders(options));
    customProviders = isPresent(providers) ? [...providers, ...customProviders]
      : customProviders;
    let bootstrapping = MeteorApp.bootstrap(component, buildNodeProviders(), customProviders);
    return bootstrapping.then(compRef => ({
      appRef: compRef.injector.get(ApplicationRef),
      compRef
    }));
  }