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:
@@ -1,7 +1,7 @@
|
||||
import {NgIf, bootstrap, Component, View} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {NgIf, Component, View} from 'angular2/core';
|
||||
import {TimerWrapper} from 'angular2/src/core/facade/async';
|
||||
|
||||
|
||||
@Component({selector: 'async-app'})
|
||||
@View({
|
||||
template: `
|
||||
@@ -12,12 +12,12 @@ import {TimerWrapper} from 'angular2/src/core/facade/async';
|
||||
<div id='delayedIncrement'>
|
||||
<span class='val'>{{val2}}</span>
|
||||
<button class='action' (click)="delayedIncrement()">Delayed Increment</button>
|
||||
<button class='cancel' *ng-if="timeoutId != null" (click)="cancelDelayedIncrement()">Cancel</button>
|
||||
<button class='cancel' *ng-if="timeoutId != null" (click)="cancelDelayedIncrement()">Cancel</button>
|
||||
</div>
|
||||
<div id='multiDelayedIncrements'>
|
||||
<span class='val'>{{val3}}</span>
|
||||
<button class='action' (click)="multiDelayedIncrements(10)">10 Delayed Increments</button>
|
||||
<button class='cancel' *ng-if="multiTimeoutId != null" (click)="cancelMultiDelayedIncrements()">Cancel</button>
|
||||
<button class='cancel' *ng-if="multiTimeoutId != null" (click)="cancelMultiDelayedIncrements()">Cancel</button>
|
||||
</div>
|
||||
<div id='periodicIncrement'>
|
||||
<span class='val'>{{val4}}</span>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {bootstrap, Component, View} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
|
||||
@Component({selector: 'gestures-app'})
|
||||
@View({templateUrl: 'template.html'})
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {ElementRef, Component, Directive, View, Injectable, Renderer} from 'angular2/angular2';
|
||||
import {ElementRef, Component, Directive, View, Injectable} from 'angular2/core';
|
||||
import {Renderer} from 'angular2/render';
|
||||
|
||||
// A service available to the Injector, used by the HelloCmp component.
|
||||
@Injectable()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {bootstrap, Component, View} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
import {KeyEventsPlugin} from 'angular2/src/core/render/dom/events/key_events';
|
||||
|
||||
@Component({selector: 'key-events-app'})
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import {bootstrap, Component, View, NgFor, ViewEncapsulation} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, Component, NgFor, UrlResolver, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdButton, MdAnchor} from 'angular2_material/src/components/button/button';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
import {bind} from 'angular2/di';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {bootstrap, Component, Directive, View, ViewEncapsulation} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, Component, Directive, UrlResolver, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdCheckbox} from 'angular2_material/src/components/checkbox/checkbox';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
import {bind} from 'angular2/di';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
BaseException
|
||||
} from 'angular2/src/core/facade/lang';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {Injectable} from 'angular2/di';
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter';
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
bootstrap,
|
||||
bind,
|
||||
ElementRef,
|
||||
ComponentRef,
|
||||
Component,
|
||||
UrlResolver,
|
||||
View,
|
||||
ViewEncapsulation
|
||||
} from 'angular2/bootstrap';
|
||||
} from 'angular2/core';
|
||||
import {
|
||||
MdDialog,
|
||||
MdDialogRef,
|
||||
MdDialogConfig
|
||||
} from 'angular2_material/src/components/dialog/dialog';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
import {bind} from 'angular2/di';
|
||||
import {isPresent} from 'angular2/src/core/facade/lang';
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {bootstrap, Component, View, ViewEncapsulation} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, Component, UrlResolver, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdGridList, MdGridTile} from 'angular2_material/src/components/grid_list/grid_list';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
import {bind} from 'angular2/di';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import {bootstrap, Component, View, ViewEncapsulation} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, Component, UrlResolver, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdInputContainer, MdInput} from 'angular2_material/src/components/input/input';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
import {bind} from 'angular2/di';
|
||||
|
||||
@Component({selector: 'demo-app'})
|
||||
@View({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {bootstrap, Component, View, ViewEncapsulation} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, Component, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdProgressLinear} from 'angular2_material/src/components/progress-linear/progress_linear';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
import {bind} from 'angular2/di';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import {bootstrap, Component, View, ViewEncapsulation} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, Component, UrlResolver, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdRadioButton, MdRadioGroup} from 'angular2_material/src/components/radio/radio_button';
|
||||
import {MdRadioDispatcher} from 'angular2_material/src/components/radio/radio_dispatcher';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
import {bind} from 'angular2/di';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {bootstrap, Component, View, ViewEncapsulation} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, Component, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdSwitch} from 'angular2_material/src/components/switcher/switch';
|
||||
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
import {bind} from 'angular2/di';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
import {bootstrap, NgIf, NgFor, Component, Directive, View, Host} from 'angular2/bootstrap';
|
||||
import {FORM_DIRECTIVES, NgControl, Validators, NgFormModel, FormBuilder} from 'angular2/forms';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
FORM_DIRECTIVES,
|
||||
NgControl,
|
||||
Validators,
|
||||
NgFormModel,
|
||||
FormBuilder,
|
||||
NgIf,
|
||||
NgFor,
|
||||
Component,
|
||||
Directive,
|
||||
View,
|
||||
Host
|
||||
} from 'angular2/core';
|
||||
|
||||
import {RegExpWrapper, print, isPresent} from 'angular2/src/core/facade/lang';
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
library benchmarks.src.naive_infinite_scroll.app;
|
||||
|
||||
import "package:angular2/src/core/facade/collection.dart" show List, ListWrapper;
|
||||
import "package:angular2/directives.dart" show NgIf, NgFor;
|
||||
import "scroll_area.dart" show ScrollAreaComponent;
|
||||
import "package:angular2/angular2.dart" show Component, Directive, View, IterableDiffers, SkipSelf, Binding;
|
||||
import "package:angular2/src/core/directives/observable_list_diff.dart" show ObservableListDiffFactory;
|
||||
import "package:angular2/core.dart" show ObservableListDiffFactory, NgIf, NgFor;
|
||||
import 'package:observe/observe.dart' show ObservableList;
|
||||
|
||||
createDiffers(IterableDiffers parent) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import "package:angular2/src/core/facade/collection.dart"
|
||||
show List, ListWrapper, Map;
|
||||
import "common.dart"
|
||||
show Company, Opportunity, Offering, Account, CustomDate, STATUS_LIST;
|
||||
import "package:angular2/directives.dart" show NgFor;
|
||||
import "package:angular2/core.dart" show NgFor;
|
||||
import "package:angular2/angular2.dart" show Component, Directive, View, ChangeDetectionStrategy;
|
||||
|
||||
class HasStyle {
|
||||
|
||||
@@ -4,7 +4,7 @@ import "package:angular2/bootstrap.dart" show bootstrap;
|
||||
import "app.dart" show App;
|
||||
import "package:angular2/src/core/compiler/view_pool.dart"
|
||||
show APP_VIEW_POOL_CAPACITY;
|
||||
import "package:angular2/di.dart" show bind;
|
||||
import "package:angular2/core.dart" show bind;
|
||||
|
||||
main() {
|
||||
bootstrap(App, createBindings());
|
||||
|
||||
@@ -14,7 +14,7 @@ import "common.dart"
|
||||
HEIGHT;
|
||||
import "random_data.dart" show generateOfferings;
|
||||
import "scroll_item.dart" show ScrollItemComponent;
|
||||
import "package:angular2/directives.dart" show NgFor;
|
||||
import "package:angular2/core.dart" show NgFor;
|
||||
|
||||
@Component(selector: "scroll-area", changeDetection: ChangeDetectionStrategy.OnPushObserve)
|
||||
@View(directives: const [ScrollItemComponent, NgFor], template: '''
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
bootstrap,
|
||||
NgIf,
|
||||
NgFor,
|
||||
Component,
|
||||
@@ -8,12 +8,10 @@ import {
|
||||
Host,
|
||||
forwardRef,
|
||||
Binding,
|
||||
EventEmitter
|
||||
} from 'angular2/bootstrap';
|
||||
|
||||
import {Injectable} from 'angular2/di';
|
||||
|
||||
import {FORM_DIRECTIVES} from 'angular2/forms';
|
||||
EventEmitter,
|
||||
FORM_DIRECTIVES,
|
||||
Injectable
|
||||
} from 'angular2/core';
|
||||
|
||||
import {ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
bootstrap,
|
||||
NgIf,
|
||||
NgFor,
|
||||
Component,
|
||||
@@ -7,12 +7,10 @@ import {
|
||||
View,
|
||||
Host,
|
||||
forwardRef,
|
||||
Binding
|
||||
} from 'angular2/bootstrap';
|
||||
|
||||
import {Injectable} from 'angular2/di';
|
||||
|
||||
import {FORM_DIRECTIVES} from 'angular2/forms';
|
||||
Binding,
|
||||
FORM_DIRECTIVES,
|
||||
Injectable
|
||||
} from 'angular2/core';
|
||||
|
||||
import {CONST_EXPR} from 'angular2/src/core/facade/lang';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {BaseException} from 'angular2/src/core/facade/lang';
|
||||
import {bootstrap, Component, View} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
|
||||
@Component({
|
||||
selector: 'error-app',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
bootstrap,
|
||||
NgIf,
|
||||
NgFor,
|
||||
Component,
|
||||
@@ -8,9 +8,12 @@ import {
|
||||
Host,
|
||||
NG_VALIDATORS,
|
||||
forwardRef,
|
||||
Binding
|
||||
} from 'angular2/bootstrap';
|
||||
import {FORM_DIRECTIVES, NgControl, Validators, NgForm} from 'angular2/forms';
|
||||
Binding,
|
||||
FORM_DIRECTIVES,
|
||||
NgControl,
|
||||
Validators,
|
||||
NgForm
|
||||
} from 'angular2/core';
|
||||
|
||||
import {RegExpWrapper, print, isPresent, CONST_EXPR} from 'angular2/src/core/facade/lang';
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {bootstrap, NgFor, Component, View} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {NgFor, Component, View} from 'angular2/core';
|
||||
import {Store, Todo, TodoFactory} from './services/TodoStore';
|
||||
|
||||
@Component({selector: 'todo-app', viewBindings: [Store, TodoFactory]})
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {ElementRef, Component, Directive, View, Injectable, Renderer} from 'angular2/angular2';
|
||||
import {ElementRef, Component, Directive, View, Injectable} from 'angular2/core';
|
||||
import {Renderer} from 'angular2/render';
|
||||
import {StringWrapper} from 'angular2/src/core/facade/lang';
|
||||
|
||||
// A service available to the Injector, used by the HelloCmp component.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {bootstrap, Component, View, NgFor} from 'angular2/bootstrap';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View, NgFor} from 'angular2/core';
|
||||
import {Zippy} from './zippy';
|
||||
|
||||
@Component({selector: 'zippy-app'})
|
||||
|
||||
Reference in New Issue
Block a user