feat(core): enable dev mode by default
BREAKING CHANGE Before Previously Angular would run in dev prod mode by default, and you could enable the dev mode by calling enableDevMode. After Now, Angular runs in the dev mode by default, and you can enable the prod mode by calling enableProdMode.
This commit is contained in:
@ -34,9 +34,10 @@ import {
|
||||
unimplemented
|
||||
} from 'angular2/src/facade/exceptions';
|
||||
import {internalView} from 'angular2/src/core/linker/view_ref';
|
||||
import {Console} from 'angular2/src/core/console';
|
||||
import {wtfLeave, wtfCreateScope, WtfScopeFn} from './profile/profile';
|
||||
import {ChangeDetectorRef} from 'angular2/src/core/change_detection/change_detector_ref';
|
||||
import {lockDevMode} from 'angular2/src/facade/lang';
|
||||
import {lockMode} from 'angular2/src/facade/lang';
|
||||
|
||||
/**
|
||||
* Construct providers specific to an individual root component.
|
||||
@ -98,7 +99,7 @@ var _platformProviders: any[];
|
||||
* provides, Angular will throw an exception.
|
||||
*/
|
||||
export function platform(providers?: Array<Type | Provider | any[]>): PlatformRef {
|
||||
lockDevMode();
|
||||
lockMode();
|
||||
if (isPresent(_platform)) {
|
||||
if (ListWrapper.equals(_platformProviders, providers)) {
|
||||
return _platform;
|
||||
@ -425,7 +426,15 @@ export class ApplicationRef_ extends ApplicationRef {
|
||||
completer.reject(e, e.stack);
|
||||
}
|
||||
});
|
||||
return completer.promise;
|
||||
return completer.promise.then(_ => {
|
||||
let c = this._injector.get(Console);
|
||||
let modeDescription =
|
||||
assertionsEnabled() ?
|
||||
"in the development mode. Call enableProdMode() to enable the production mode." :
|
||||
"in the production mode. Call enableDevMode() to enable the development mode.";
|
||||
c.log(`Angular 2 is running ${modeDescription}`);
|
||||
return _;
|
||||
});
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
Reference in New Issue
Block a user