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:
@@ -15,6 +15,7 @@ import {
|
||||
import {IS_DART, isPresent, stringify} from 'angular2/src/facade/lang';
|
||||
import {bootstrap} from 'angular2/platform/browser';
|
||||
import {ApplicationRef} from 'angular2/src/core/application_ref';
|
||||
import {Console} from 'angular2/src/core/console';
|
||||
import {Component, Directive, View, OnDestroy, platform} from 'angular2/core';
|
||||
import {BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS} from 'angular2/platform/browser';
|
||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||
@@ -88,6 +89,10 @@ class _ArrayLogger {
|
||||
}
|
||||
|
||||
|
||||
class DummyConsole implements Console {
|
||||
log(message) {}
|
||||
}
|
||||
|
||||
export function main() {
|
||||
var fakeDoc, el, el2, testProviders, lightDom;
|
||||
|
||||
@@ -101,7 +106,8 @@ export function main() {
|
||||
DOM.appendChild(fakeDoc.body, el2);
|
||||
DOM.appendChild(el, lightDom);
|
||||
DOM.setText(lightDom, 'loading');
|
||||
testProviders = [provide(DOCUMENT, {useValue: fakeDoc})];
|
||||
testProviders =
|
||||
[provide(DOCUMENT, {useValue: fakeDoc}), provide(Console, {useClass: DummyConsole})];
|
||||
});
|
||||
|
||||
afterEach(disposePlatform);
|
||||
|
||||
@@ -1010,7 +1010,7 @@ var NG_CORE = [
|
||||
'EventEmitter.emit():js',
|
||||
'OutputMetadata',
|
||||
'OutputMetadata.bindingPropertyName',
|
||||
'enableDevMode():js',
|
||||
'enableProdMode():js',
|
||||
'ExpressionChangedAfterItHasBeenCheckedException',
|
||||
'ExpressionChangedAfterItHasBeenCheckedException.message',
|
||||
'ExpressionChangedAfterItHasBeenCheckedException.stackTrace',
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import {bootstrap} from 'angular2/platform/browser';
|
||||
import {Component, Directive, View} from 'angular2/src/core/metadata';
|
||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||
import {Console} from 'angular2/src/core/console';
|
||||
import {provide, ViewChild, AfterViewInit} from 'angular2/core';
|
||||
import {DOCUMENT} from 'angular2/src/platform/dom/dom_tokens';
|
||||
import {RouteConfig, Route, Redirect, AuxRoute} from 'angular2/src/router/route_config_decorator';
|
||||
@@ -36,6 +37,10 @@ import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';
|
||||
import {ApplicationRef} from 'angular2/src/core/application_ref';
|
||||
import {MockApplicationRef} from 'angular2/src/mock/mock_application_ref';
|
||||
|
||||
class DummyConsole implements Console {
|
||||
log(message) {}
|
||||
}
|
||||
|
||||
export function main() {
|
||||
describe('router bootstrap', () => {
|
||||
beforeEachProviders(() => [
|
||||
@@ -56,7 +61,8 @@ export function main() {
|
||||
ROUTER_PROVIDERS,
|
||||
provide(ROUTER_PRIMARY_COMPONENT, {useValue: AppCmp}),
|
||||
provide(LocationStrategy, {useClass: MockLocationStrategy}),
|
||||
provide(DOCUMENT, {useValue: fakeDoc})
|
||||
provide(DOCUMENT, {useValue: fakeDoc}),
|
||||
provide(Console, {useClass: DummyConsole})
|
||||
])
|
||||
.then((applicationRef) => {
|
||||
var router = applicationRef.hostComponent.router;
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
import {bootstrap} from 'angular2/platform/browser';
|
||||
import {Component, Directive, View} from 'angular2/src/core/metadata';
|
||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
||||
import {Console} from 'angular2/src/core/console';
|
||||
import {provide} from 'angular2/core';
|
||||
import {DOCUMENT} from 'angular2/src/platform/dom/dom_tokens';
|
||||
import {Type, IS_DART} from 'angular2/src/facade/lang';
|
||||
@@ -38,6 +39,10 @@ class _ArrayLogger {
|
||||
logGroupEnd(){};
|
||||
}
|
||||
|
||||
class DummyConsole implements Console {
|
||||
log(message) {}
|
||||
}
|
||||
|
||||
export function main() {
|
||||
describe('RouteConfig with POJO arguments', () => {
|
||||
var fakeDoc, el, testBindings;
|
||||
@@ -51,7 +56,8 @@ export function main() {
|
||||
ROUTER_PROVIDERS,
|
||||
provide(LocationStrategy, {useClass: MockLocationStrategy}),
|
||||
provide(DOCUMENT, {useValue: fakeDoc}),
|
||||
provide(ExceptionHandler, {useValue: exceptionHandler})
|
||||
provide(ExceptionHandler, {useValue: exceptionHandler}),
|
||||
provide(Console, {useClass: DummyConsole})
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user