refactor(playground): remove imports from 'angular2/angular2'

Part of #5710

Closes #5798
This commit is contained in:
Pawel Kozlowski 2015-12-10 16:24:34 +01:00
parent df6d2d1e23
commit 8d3e5596dc
11 changed files with 28 additions and 31 deletions

View File

@ -1,8 +1,7 @@
import {Component, View, NgIf} from 'angular2/angular2'; import {Component} from 'angular2/core';
@Component({selector: 'animate-app'}) @Component({
@View({ selector: 'animate-app',
directives: [NgIf],
template: ` template: `
<h1>The box is {{visible ? 'visible' : 'hidden'}}</h1> <h1>The box is {{visible ? 'visible' : 'hidden'}}</h1>
<div class="ng-animate box" *ngIf="visible"></div> <div class="ng-animate box" *ngIf="visible"></div>

View File

@ -1,4 +1,4 @@
import {Component, provide} from 'angular2/angular2'; import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap'; import {bootstrap} from 'angular2/bootstrap';
import { import {
RouteConfig, RouteConfig,

View File

@ -1,10 +1,9 @@
import {Component, View, NgFor} from 'angular2/angular2'; import {Component} from 'angular2/core';
import {Http, Response} from 'angular2/http'; import {Http, Response} from 'angular2/http';
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
@Component({selector: 'http-app'}) @Component({
@View({ selector: 'http-app',
directives: [NgFor],
template: ` template: `
<h1>people</h1> <h1>people</h1>
<ul class="people"> <ul class="people">

View File

@ -1,10 +1,9 @@
import {Component, View, NgFor} from 'angular2/angular2'; import {Component} from 'angular2/core';
import {Jsonp, Response} from 'angular2/http'; import {Jsonp, Response} from 'angular2/http';
import {ObservableWrapper} from 'angular2/src/facade/async'; import {ObservableWrapper} from 'angular2/src/facade/async';
@Component({selector: 'jsonp-app'}) @Component({
@View({ selector: 'jsonp-app',
directives: [NgFor],
template: ` template: `
<h1>people</h1> <h1>people</h1>
<ul class="people"> <ul class="people">

View File

@ -1,4 +1,4 @@
import {NgIf, NgFor, EventEmitter, Component, View, Inject, Injectable} from 'angular2/angular2'; import {Component, Injectable} from 'angular2/core';
import { import {
RouterLink, RouterLink,
RouteConfig, RouteConfig,
@ -89,8 +89,7 @@ class DbService {
} }
} }
@Component({selector: 'inbox-detail'}) @Component({selector: 'inbox-detail', directives: [RouterLink], templateUrl: 'inbox-detail.html'})
@View({templateUrl: 'inbox-detail.html', directives: [NgFor, RouterLink]})
class InboxDetailCmp { class InboxDetailCmp {
record: InboxRecord = new InboxRecord(); record: InboxRecord = new InboxRecord();
ready: boolean = false; ready: boolean = false;
@ -101,8 +100,7 @@ class InboxDetailCmp {
} }
} }
@Component({selector: 'inbox'}) @Component({selector: 'inbox', templateUrl: 'inbox.html', directives: [RouterLink]})
@View({templateUrl: 'inbox.html', directives: [NgFor, RouterLink]})
class InboxCmp { class InboxCmp {
items: InboxRecord[] = []; items: InboxRecord[] = [];
ready: boolean = false; ready: boolean = false;
@ -127,8 +125,7 @@ class InboxCmp {
} }
@Component({selector: 'drafts'}) @Component({selector: 'drafts', templateUrl: 'drafts.html', directives: [RouterLink]})
@View({templateUrl: 'drafts.html', directives: [NgFor, RouterLink]})
class DraftsCmp { class DraftsCmp {
items: InboxRecord[] = []; items: InboxRecord[] = [];
ready: boolean = false; ready: boolean = false;
@ -141,8 +138,12 @@ class DraftsCmp {
} }
} }
@Component({selector: 'inbox-app', viewProviders: [DbService]}) @Component({
@View({templateUrl: 'inbox-app.html', directives: [RouterOutlet, RouterLink]}) selector: 'inbox-app',
viewProviders: [DbService],
templateUrl: 'inbox-app.html',
directives: [RouterOutlet, RouterLink]
})
@RouteConfig([ @RouteConfig([
new Route({path: '/', component: InboxCmp, name: 'Inbox'}), new Route({path: '/', component: InboxCmp, name: 'Inbox'}),
new Route({path: '/drafts', component: DraftsCmp, name: 'Drafts'}), new Route({path: '/drafts', component: DraftsCmp, name: 'Drafts'}),

View File

@ -1,5 +1,5 @@
import {InboxApp} from './inbox-app'; import {InboxApp} from './inbox-app';
import {provide} from 'angular2/angular2'; import {provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap'; import {bootstrap} from 'angular2/bootstrap';
import {ROUTER_PROVIDERS, HashLocationStrategy, LocationStrategy} from 'angular2/router'; import {ROUTER_PROVIDERS, HashLocationStrategy, LocationStrategy} from 'angular2/router';

View File

@ -1,4 +1,4 @@
import {Injectable} from 'angular2/angular2'; import {Injectable} from 'angular2/core';
import {ListWrapper, Predicate} from 'angular2/src/facade/collection'; import {ListWrapper, Predicate} from 'angular2/src/facade/collection';
// base model for RecordStore // base model for RecordStore

View File

@ -1,5 +1,5 @@
import {Component, Input, Output, EventEmitter} from 'angular2/angular2'; import {Component, Input, Output, EventEmitter} from 'angular2/core';
import {UpgradeAdapter} from 'angular2/angular2'; import {UpgradeAdapter} from 'angular2/upgrade';
import * as angular from '../../../angular2/src/upgrade/angular_js'; import * as angular from '../../../angular2/src/upgrade/angular_js';
var styles = [ var styles = [

View File

@ -1,11 +1,10 @@
import {NgZone, NgFor, Component, View, NgIf, FORM_DIRECTIVES} from 'angular2/angular2'; import {Component} from 'angular2/core';
import {BitmapService} from './services/bitmap'; import {BitmapService} from './services/bitmap';
import {EventListener} from 'angular2/src/facade/browser'; import {EventListener} from 'angular2/src/facade/browser';
import {FileReader, Uint8ArrayWrapper} from './file_api'; import {FileReader, Uint8ArrayWrapper} from './file_api';
import {TimerWrapper} from 'angular2/src/facade/async'; import {TimerWrapper} from 'angular2/src/facade/async';
@Component({selector: 'image-demo', viewProviders: [BitmapService]}) @Component({selector: 'image-demo', viewProviders: [BitmapService], templateUrl: 'image_demo.html'})
@View({templateUrl: 'image_demo.html', directives: [NgFor, NgIf, FORM_DIRECTIVES]})
export class ImageDemo { export class ImageDemo {
images = []; images = [];
fileInput: String; fileInput: String;

View File

@ -1,5 +1,5 @@
/// <reference path="../bitmap.d.ts" /> /// <reference path="../b64.d.ts" /> /// <reference path="../bitmap.d.ts" /> /// <reference path="../b64.d.ts" />
import {Injectable} from 'angular2/angular2'; import {Injectable} from 'angular2/core';
declare var base64js; declare var base64js;
// Temporary fix for Typescript issue #4220 (https://github.com/Microsoft/TypeScript/issues/4220) // Temporary fix for Typescript issue #4220 (https://github.com/Microsoft/TypeScript/issues/4220)

View File

@ -1,4 +1,4 @@
import {Component, EventEmitter, Input, Output} from 'angular2/angular2'; import {Component, EventEmitter, Input, Output} from 'angular2/core';
import {ObservableWrapper} from 'angular2/src/facade/async'; import {ObservableWrapper} from 'angular2/src/facade/async';
@Component({selector: 'zippy', templateUrl: 'zippy.html'}) @Component({selector: 'zippy', templateUrl: 'zippy.html'})