prodMode setting in the @App decorator to be able to enable the Angular2 production mode

This commit is contained in:
Erik Tufvesson
2016-02-14 12:29:14 +01:00
parent bd0376072b
commit fa1c75ffa0

View File

@ -1,4 +1,4 @@
import {Component} from 'angular2/core'; import {Component, enableProdMode} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser'; import {bootstrap} from 'angular2/platform/browser';
import {TapClick} from '../components/tap-click/tap-click'; import {TapClick} from '../components/tap-click/tap-click';
import {ionicProviders} from '../config/bootstrap'; import {ionicProviders} from '../config/bootstrap';
@ -57,6 +57,10 @@ export function App(args: any={}) {
// define array of bootstrap providers // define array of bootstrap providers
let providers = ionicProviders(args).concat(args.providers || []); let providers = ionicProviders(args).concat(args.providers || []);
if (args.prodMode) {
enableProdMode();
}
bootstrap(cls, providers).then(appRef => { bootstrap(cls, providers).then(appRef => {
appRef.injector.get(TapClick); appRef.injector.get(TapClick);
}); });