@@ -1,10 +1,10 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
import {Component} from 'angular2/core';
|
||||
import {NgIf} from 'angular2/common';
|
||||
import {TimerWrapper} from 'angular2/src/facade/async';
|
||||
|
||||
@Component({selector: 'async-app'})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'async-app',
|
||||
template: `
|
||||
<div id='increment'>
|
||||
<span class='val'>{{val1}}</span>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
import {Component} from 'angular2/core';
|
||||
|
||||
@Component({selector: 'gestures-app'})
|
||||
@View({templateUrl: 'template.html'})
|
||||
@Component({selector: 'gestures-app', templateUrl: 'template.html'})
|
||||
class GesturesCmp {
|
||||
swipeDirection: string = '-';
|
||||
pinchScale: number = 1;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
import {Component} from 'angular2/core';
|
||||
import {KeyEventsPlugin} from 'angular2/src/platform/dom/events/key_events';
|
||||
|
||||
@Component({selector: 'key-events-app'})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'key-events-app',
|
||||
template: `Click in the following area and press a key to display its name:<br>
|
||||
<div (keydown)="onKeyDown($event)" class="sample-area" tabindex="0">{{lastKey}}</div><br>
|
||||
Click in the following area and press shift.enter:<br>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, provide, Component, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {bind, provide, Component, ViewEncapsulation} from 'angular2/core';
|
||||
import {NgFor} from 'angular2/common';
|
||||
import {UrlResolver} from 'angular2/compiler';
|
||||
import {MdButton, MdAnchor} from 'angular2_material/src/components/button/button';
|
||||
@@ -7,8 +7,6 @@ import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
})
|
||||
@View({
|
||||
templateUrl: './demo_app.html',
|
||||
directives: [MdButton, MdAnchor, NgFor],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, provide, Component, Directive, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {bind, provide, Component, Directive, ViewEncapsulation} from 'angular2/core';
|
||||
import {UrlResolver} from 'angular2/compiler';
|
||||
import {MdCheckbox} from 'angular2_material/src/components/checkbox/checkbox';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
@@ -7,8 +7,6 @@ import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
})
|
||||
@View({
|
||||
templateUrl: './demo_app.html',
|
||||
directives: [MdCheckbox],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {
|
||||
bind,
|
||||
provide,
|
||||
ElementRef,
|
||||
ComponentRef,
|
||||
Component,
|
||||
View,
|
||||
ViewEncapsulation
|
||||
} from 'angular2/core';
|
||||
import {bind, provide, ElementRef, ComponentRef, Component, ViewEncapsulation} from 'angular2/core';
|
||||
import {UrlResolver} from 'angular2/compiler';
|
||||
import {
|
||||
MdDialog,
|
||||
@@ -21,8 +13,6 @@ import {isPresent} from 'angular2/src/facade/lang';
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
viewProviders: [MdDialog],
|
||||
})
|
||||
@View({
|
||||
templateUrl: './demo_app.html',
|
||||
directives: [],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
@@ -69,8 +59,6 @@ class DemoApp {
|
||||
@Component({
|
||||
selector: 'simple-dialog',
|
||||
inputs: ['numCoconuts'],
|
||||
})
|
||||
@View({
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
template: `
|
||||
<h2>This is the dialog content</h2>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, provide, Component, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {bind, provide, Component, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdGridList, MdGridTile} from 'angular2_material/src/components/grid_list/grid_list';
|
||||
import {UrlResolver} from 'angular2/compiler';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
@@ -7,8 +7,6 @@ import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
})
|
||||
@View({
|
||||
templateUrl: './demo_app.html',
|
||||
directives: [MdGridList, MdGridTile],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, provide, Component, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {bind, provide, Component, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdInputContainer, MdInput} from 'angular2_material/src/components/input/input';
|
||||
import {UrlResolver} from 'angular2/compiler';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
|
||||
@Component({selector: 'demo-app'})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
templateUrl: './demo_app.html',
|
||||
directives: [MdInputContainer, MdInput],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, provide, Component, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {bind, provide, Component, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdProgressLinear} from 'angular2_material/src/components/progress-linear/progress_linear';
|
||||
import {UrlResolver} from 'angular2/src/compiler/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
})
|
||||
@View({
|
||||
templateUrl: './demo_app.html',
|
||||
directives: [MdProgressLinear],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, provide, Component, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {bind, provide, Component, ViewEncapsulation} from 'angular2/core';
|
||||
import {UrlResolver} from 'angular2/compiler';
|
||||
import {MdRadioButton, MdRadioGroup} from 'angular2_material/src/components/radio/radio_button';
|
||||
import {MdRadioDispatcher} from 'angular2_material/src/components/radio/radio_dispatcher';
|
||||
@@ -8,8 +8,6 @@ import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
viewProviders: [MdRadioDispatcher],
|
||||
})
|
||||
@View({
|
||||
templateUrl: './demo_app.html',
|
||||
directives: [MdRadioGroup, MdRadioButton],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {bind, provide, Component, View, ViewEncapsulation} from 'angular2/core';
|
||||
import {bind, provide, Component, ViewEncapsulation} from 'angular2/core';
|
||||
import {MdSwitch} from 'angular2_material/src/components/switcher/switch';
|
||||
import {UrlResolver} from 'angular2/src/compiler/url_resolver';
|
||||
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
})
|
||||
@View({
|
||||
templateUrl: './demo_app.html',
|
||||
directives: [MdSwitch],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
NgIf,
|
||||
NgFor
|
||||
} from 'angular2/common';
|
||||
import {Component, Directive, View, Host} from 'angular2/core';
|
||||
import {Component, Directive, Host} from 'angular2/core';
|
||||
|
||||
import {RegExpWrapper, print, isPresent} from 'angular2/src/facade/lang';
|
||||
import {AbstractControl} from 'angular2/common';
|
||||
@@ -40,8 +40,9 @@ function creditCardValidator(c: AbstractControl): {[key: string]: boolean} {
|
||||
* actual error message.
|
||||
* To make it simple, we are using a simple map here.
|
||||
*/
|
||||
@Component({selector: 'show-error', inputs: ['controlPath: control', 'errorTypes: errors']})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'show-error',
|
||||
inputs: ['controlPath: control', 'errorTypes: errors'],
|
||||
template: `
|
||||
<span *ngIf="errorMessage !== null">{{errorMessage}}</span>
|
||||
`,
|
||||
@@ -74,8 +75,9 @@ class ShowError {
|
||||
}
|
||||
|
||||
|
||||
@Component({selector: 'model-driven-forms', viewProviders: [FormBuilder]})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'model-driven-forms',
|
||||
viewProviders: [FormBuilder],
|
||||
template: `
|
||||
<h1>Checkout Form (Model Driven)</h1>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, Directive, View, Host, forwardRef, Provider, Injectable} from 'angular2/core';
|
||||
import {Component, Directive, Host, forwardRef, Provider, Injectable} from 'angular2/core';
|
||||
import {NgIf, NgFor, FORM_DIRECTIVES} from 'angular2/common';
|
||||
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
@@ -76,8 +76,8 @@ class DataService {
|
||||
|
||||
// ---- components
|
||||
|
||||
@Component({selector: 'full-name-cmp'})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'full-name-cmp',
|
||||
template: `
|
||||
<h1>Edit Full Name</h1>
|
||||
<div>
|
||||
@@ -107,8 +107,8 @@ class FullNameComponent {
|
||||
get person(): Person { return this._service.currentPerson; }
|
||||
}
|
||||
|
||||
@Component({selector: 'person-detail-cmp'})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'person-detail-cmp',
|
||||
template: `
|
||||
<h2>{{person.fullName}}</h2>
|
||||
|
||||
@@ -155,8 +155,8 @@ class PersonsDetailComponent {
|
||||
get person(): Person { return this._service.currentPerson; }
|
||||
}
|
||||
|
||||
@Component({selector: 'persons-cmp'})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'persons-cmp',
|
||||
template: `
|
||||
<h1>FullName Demo</h1>
|
||||
<div>
|
||||
@@ -180,8 +180,9 @@ class PersonsComponent {
|
||||
}
|
||||
|
||||
|
||||
@Component({selector: 'person-management-app', viewBindings: [DataService]})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'person-management-app',
|
||||
viewBindings: [DataService],
|
||||
template: `
|
||||
<button (click)="switchToEditName()">Edit Full Name</button>
|
||||
<button (click)="switchToPersonList()">Person Array</button>
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
import {Component} from 'angular2/core';
|
||||
|
||||
@Component({
|
||||
selector: 'error-app',
|
||||
})
|
||||
@View({
|
||||
template: `
|
||||
<button class="errorButton" (click)="createError()">create error</button>`
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, Directive, View, Host, forwardRef, Provider} from 'angular2/core';
|
||||
import {Component, Directive, Host, forwardRef, Provider} from 'angular2/core';
|
||||
import {
|
||||
ControlGroup,
|
||||
NgIf,
|
||||
@@ -61,8 +61,9 @@ class CreditCardValidator {
|
||||
* actual error message.
|
||||
* To make it simple, we are using a simple map here.
|
||||
*/
|
||||
@Component({selector: 'show-error', inputs: ['controlPath: control', 'errorTypes: errors']})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'show-error',
|
||||
inputs: ['controlPath: control', 'errorTypes: errors'],
|
||||
template: `
|
||||
<span *ngIf="errorMessage !== null">{{errorMessage}}</span>
|
||||
`,
|
||||
@@ -95,8 +96,8 @@ class ShowError {
|
||||
}
|
||||
|
||||
|
||||
@Component({selector: 'template-driven-forms'})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'template-driven-forms',
|
||||
template: `
|
||||
<h1>Checkout Form</h1>
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
import {Component} from 'angular2/core';
|
||||
import {NgFor} from 'angular2/common';
|
||||
import {Store, Todo, TodoFactory} from './services/TodoStore';
|
||||
|
||||
@Component({selector: 'todo-app', viewProviders: [Store, TodoFactory]})
|
||||
@View({templateUrl: 'todo.html', directives: [NgFor]})
|
||||
@Component({
|
||||
selector: 'todo-app',
|
||||
viewProviders: [Store, TodoFactory],
|
||||
templateUrl: 'todo.html',
|
||||
directives: [NgFor]
|
||||
})
|
||||
class TodoApp {
|
||||
todoEdit: Todo = null;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Renderer, ElementRef, Component, Directive, View, Injectable} from 'angular2/core';
|
||||
import {Renderer, ElementRef, Component, Directive, Injectable} from 'angular2/core';
|
||||
import {StringWrapper} from 'angular2/src/facade/lang';
|
||||
|
||||
// A service available to the Injector, used by the HelloCmp component.
|
||||
@@ -33,10 +33,8 @@ class RedDec {
|
||||
selector: 'hello-app',
|
||||
// These are services that would be created if a class in the component's
|
||||
// template tries to inject them.
|
||||
viewProviders: [GreetingService]
|
||||
})
|
||||
// The template for the component.
|
||||
@View({
|
||||
viewProviders: [GreetingService],
|
||||
// The template for the component.
|
||||
// Expressions in the template (like {{greeting}}) are evaluated in the
|
||||
// context of the HelloCmp class below.
|
||||
template: `<div class="greeting">{{greeting}} <span red>world</span>!</div>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import {PromiseWrapper} from "angular2/src/facade/async";
|
||||
import {Component, View} from "angular2/core";
|
||||
import {Component} from "angular2/core";
|
||||
import {ServiceMessageBrokerFactory, PRIMITIVE} from "angular2/platform/worker_app";
|
||||
|
||||
const ECHO_CHANNEL = "ECHO";
|
||||
|
||||
@Component({selector: 'app'})
|
||||
@View({template: "<h1>WebWorker MessageBroker Test</h1>"})
|
||||
@Component({selector: 'app', template: "<h1>WebWorker MessageBroker Test</h1>"})
|
||||
export class App {
|
||||
constructor(private _serviceBrokerFactory: ServiceMessageBrokerFactory) {
|
||||
var broker = _serviceBrokerFactory.createMessageBroker(ECHO_CHANNEL, false);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Component, View} from 'angular2/core';
|
||||
import {Component} from 'angular2/core';
|
||||
import {Start} from './components/start';
|
||||
import {About} from './components/about';
|
||||
import {Contact} from './components/contact';
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import {View, Component} from 'angular2/core';
|
||||
import {Component} from 'angular2/core';
|
||||
import {NgFor, FORM_DIRECTIVES} from 'angular2/common';
|
||||
import {Store, Todo, TodoFactory} from './services/TodoStore';
|
||||
|
||||
@Component({selector: 'todo-app', viewProviders: [Store, TodoFactory]})
|
||||
@View({templateUrl: 'todo.html', directives: [NgFor, FORM_DIRECTIVES]})
|
||||
@Component({
|
||||
selector: 'todo-app',
|
||||
viewProviders: [Store, TodoFactory],
|
||||
templateUrl: 'todo.html',
|
||||
directives: [NgFor, FORM_DIRECTIVES]
|
||||
})
|
||||
export class TodoApp {
|
||||
todoEdit: Todo = null;
|
||||
inputValue: string;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {Component, View} from 'angular2/core';
|
||||
import {Component} from 'angular2/core';
|
||||
import {Zippy} from './zippy';
|
||||
|
||||
@Component({selector: 'zippy-app'})
|
||||
@View({
|
||||
@Component({
|
||||
selector: 'zippy-app',
|
||||
template: `
|
||||
<zippy (open)="pushLog('open')" (close)="pushLog('close')" title="Details">
|
||||
This is some content.
|
||||
|
||||
Reference in New Issue
Block a user