refactor: export core APIs from angular2/core
This change moves many APIs to the angular2/core export.
This change also automatically adds FORM_BINDINGS in
the application root injector.
BREAKING CHANGE:
Many dependencies that were previously exported from specific
APIs are now exported from angular2/core. Affected exports, which
should now be included from angular2/core include:
angular2/forms
angular2/di
angular2/directives
angular2/change_detection
angular2/bootstrap (except for dart users)
angular2/render
angular2/metadata
angular2/debug
angular2/pipes
Closes #3977
This commit is contained in:
@@ -13,7 +13,7 @@ import {Compiler, CompilerCache} from 'angular2/src/core/compiler/compiler';
|
||||
import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver';
|
||||
import {PipeResolver} from 'angular2/src/core/compiler/pipe_resolver';
|
||||
|
||||
import {Component, Directive, View, ViewMetadata} from 'angular2/metadata';
|
||||
import {Component, Directive, View, ViewMetadata} from 'angular2/src/core/metadata';
|
||||
import {ViewResolver} from 'angular2/src/core/compiler/view_resolver';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {AppRootUrl} from 'angular2/src/core/services/app_root_url';
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
bootstrap,
|
||||
Component,
|
||||
Directive,
|
||||
DynamicComponentLoader,
|
||||
ElementRef,
|
||||
View
|
||||
} from 'angular2/bootstrap';
|
||||
View,
|
||||
NgIf,
|
||||
NgFor
|
||||
} from 'angular2/core';
|
||||
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
||||
import {ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {getIntParameter, bindAction} from 'angular2/src/test_lib/benchmark_util';
|
||||
import {NgIf, NgFor} from 'angular2/directives';
|
||||
|
||||
var testList = null;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Injectable, Injector, Key, bind} from "angular2/di";
|
||||
import {Injectable, Injector, Key, bind} from "angular2/core";
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities';
|
||||
import {getIntParameter, bindAction, microBenchmark} from 'angular2/src/test_lib/benchmark_util';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities';
|
||||
import {Injectable, Injector} from 'angular2/di';
|
||||
import {Injectable, Injector} from 'angular2/core';
|
||||
import {ProtoElementInjector, DirectiveBinding} from 'angular2/src/core/compiler/element_injector';
|
||||
import {getIntParameter, bindAction, microBenchmark} from 'angular2/src/test_lib/benchmark_util';
|
||||
import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter';
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import {bootstrap, Component, Directive, View} from 'angular2/bootstrap';
|
||||
|
||||
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
||||
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {window, document, gc} from 'angular2/src/core/facade/browser';
|
||||
import {
|
||||
@@ -11,14 +7,23 @@ import {
|
||||
windowProfile,
|
||||
windowProfileEnd
|
||||
} from 'angular2/src/test_lib/benchmark_util';
|
||||
|
||||
import {NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/directives';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
Component,
|
||||
Directive,
|
||||
View,
|
||||
bind,
|
||||
NgFor,
|
||||
NgSwitch,
|
||||
NgSwitchWhen,
|
||||
NgSwitchDefault,
|
||||
LifeCycle
|
||||
} from 'angular2/core';
|
||||
import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter';
|
||||
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool';
|
||||
|
||||
import {ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
|
||||
import {bind} from 'angular2/di';
|
||||
import {Inject} from 'angular2/src/core/di/decorators';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {isPresent} from 'angular2/src/core/facade/lang';
|
||||
import {getIntParameter, bindAction} from 'angular2/src/test_lib/benchmark_util';
|
||||
import {TimerWrapper} from 'angular2/src/core/facade/async';
|
||||
import {ScrollAreaComponent} from './scroll_area';
|
||||
import {NgIf, NgFor} from 'angular2/directives';
|
||||
import {NgIf, NgFor} from 'angular2/core';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {document} from 'angular2/src/core/facade/browser';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {ListWrapper, Map} from 'angular2/src/core/facade/collection';
|
||||
import {Company, Opportunity, Offering, Account, CustomDate, STATUS_LIST} from './common';
|
||||
import {NgFor} from 'angular2/directives';
|
||||
import {NgFor} from 'angular2/core';
|
||||
|
||||
import {Component, Directive, View} from 'angular2/angular2';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import {bootstrap} from 'angular2/bootstrap';
|
||||
import {App} from './app';
|
||||
|
||||
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool';
|
||||
import {bind} from 'angular2/di';
|
||||
import {bind} from 'angular2/core';
|
||||
|
||||
export function main() {
|
||||
bootstrap(App, createBindings());
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
} from './common';
|
||||
import {generateOfferings} from './random_data';
|
||||
import {ScrollItemComponent} from './scroll_item';
|
||||
import {NgFor} from 'angular2/directives';
|
||||
import {NgFor} from 'angular2/core';
|
||||
|
||||
@Component({
|
||||
selector: 'scroll-area',
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
bootstrap,
|
||||
Compiler,
|
||||
Component,
|
||||
Directive,
|
||||
View,
|
||||
ViewContainerRef
|
||||
} from 'angular2/bootstrap';
|
||||
ViewContainerRef,
|
||||
bind,
|
||||
Binding,
|
||||
NgIf
|
||||
} from 'angular2/core';
|
||||
|
||||
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
@@ -19,10 +22,8 @@ import {
|
||||
windowProfile,
|
||||
windowProfileEnd
|
||||
} from 'angular2/src/test_lib/benchmark_util';
|
||||
import {NgIf} from 'angular2/directives';
|
||||
import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter';
|
||||
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool';
|
||||
import {bind, Binding} from 'angular2/di';
|
||||
|
||||
function createBindings(): Binding[] {
|
||||
var viewCacheCapacity = getStringParameter('viewcache') == 'true' ? 10000 : 0;
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
bootstrap,
|
||||
Compiler,
|
||||
Component,
|
||||
Directive,
|
||||
View,
|
||||
ViewContainerRef
|
||||
} from 'angular2/bootstrap';
|
||||
ViewContainerRef,
|
||||
bind,
|
||||
Binding,
|
||||
NgIf
|
||||
} from 'angular2/core';
|
||||
|
||||
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
@@ -18,10 +21,8 @@ import {
|
||||
windowProfile,
|
||||
windowProfileEnd
|
||||
} from 'angular2/src/test_lib/benchmark_util';
|
||||
import {NgIf} from 'angular2/directives';
|
||||
import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter';
|
||||
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool';
|
||||
import {bind, Binding} from 'angular2/di';
|
||||
|
||||
function createBindings(): Binding[] {
|
||||
var viewCacheCapacity = getStringParameter('viewcache') == 'true' ? 10000 : 1;
|
||||
|
||||
Reference in New Issue
Block a user