This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import chai from 'chai'; | |
| chai.should(); | |
| let { expect } = chai; | |
| export { expect }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Component} from 'angular2/core'; | |
| import {Observable} from 'rxjs'; | |
| import {Store} from '@ngrx/store'; | |
| interface ITodoState{ | |
| todos: string[]; | |
| } | |
| @Component({ | |
| selector: 'todo-list', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Component, Injectable, provide} from 'angular2/core'; | |
| abstract class AbstractTodoService{...} | |
| @Injectable() | |
| class TodoService extends AbstractTodoService{...} | |
| @Component({ | |
| selector: 'todo-home', | |
| viewProviders: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface ILights{ } | |
| class Camera<T>{ } | |
| class Action{ } | |
| @Injectable() | |
| class MyService{ | |
| constructor(lights: ILights, camera: Camera<string>, actions: Action[]){ } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Reducer, Store, createStore} from 'redux'; | |
| import {provide} from 'angular2/core'; | |
| provide(Reducer, { useValue: function appReducer(){ } }); | |
| provide(Store, { | |
| deps: [Reducer], | |
| useFactory: createStore | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Inject} from ‘angular2/core’; | |
| import {Store} from ‘redux’; | |
| import {REDUX_STORE} from ‘../di-tokens’; | |
| class MyService{ | |
| // This is pretty redundant… | |
| constructor(@Inject(REDUX_STORE) store: Store){ } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Optional} from ‘angular2/core’; | |
| class Foo{ | |
| constructor(@Optional() bar: Bar){ } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {OptionalMetadata} from 'angular2/core'; | |
| class Foo{ | |
| static parameters = [[new OptionalMetadata(), Bar]]; | |
| constructor(bar){ } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Foo = ng.core. | |
| Injectable(). | |
| Class({ | |
| constructor: [ | |
| [new ng.core.OptionalMetadata(), Bar], | |
| function(bar){ | |
| } | |
| ] | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| PLATFORM_DIRECTIVES, | |
| provide, | |
| bootstrap | |
| } from 'angular2/core'; | |
| import { | |
| ROUTER_PROVIDERS, | |
| ROUTER_DIRECTIVES, | |
| LocationStrategy, |
OlderNewer