How to use the angular2-universal.createPrebootCode 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 / modules / bootloader.ts View on Github external
.then(config => {
      let preboot = _.extend({ debug: options.debug }, options.preboot);
      let prebootCode = createPrebootCode(component, preboot);

      return prebootCode
        .then(code => {
          let el = config.compRef.location.nativeElement;
          let script = parseFragment(code);
          let prebootEl = DOM.createElement('div');
          DOM.setInnerHTML(prebootEl, code);
          DOM.insertAfter(el, prebootEl);
          let logger = config.appRef.injector.get(Logger);
          logger.debug('preboot source code rendered');
          return config;
        });
    })
    .then(config => {
github barbatus / angular2-meteor-universal / build / bootloader.js View on Github external
.then(function (config) {
            var preboot = _.extend({ debug: options.debug }, options.preboot);
            var prebootCode = angular2_universal_1.createPrebootCode(component, preboot);
            return prebootCode
                .then(function (code) {
                var el = config.compRef.location.nativeElement;
                var script = angular2_universal_1.parseFragment(code);
                var prebootEl = DOM.createElement('div');
                DOM.setInnerHTML(prebootEl, code);
                DOM.insertAfter(el, prebootEl);
                var logger = config.appRef.injector.get(logger_1.Logger);
                logger.debug('preboot source code rendered');
                return config;
            });
        })
            .then(function (config) {