Skip to content

Instantly share code, notes, and snippets.

View MikeRyanDev's full-sized avatar

Mike Ryan MikeRyanDev

View GitHub Profile
@MikeRyanDev
MikeRyanDev / output.js
Created October 30, 2015 03:13
TypeScript not compiling correctly
import chai from 'chai';
chai.should();
let { expect } = chai;
export { expect };
interface ILights{ }
class Camera<T>{ }
class Action{ }
@Injectable()
class MyService{
constructor(lights: ILights, camera: Camera<string>, actions: Action[]){ }
}
import {Reducer, Store, createStore} from 'redux';
import {provide} from 'angular2/core';
provide(Reducer, { useValue: function appReducer(){ } });
provide(Store, {
deps: [Reducer],
useFactory: createStore
});
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){ }
}
import {Optional} from ‘angular2/core’;
class Foo{
 constructor(@Optional() bar: Bar){ }
}
import {OptionalMetadata} from 'angular2/core';
class Foo{
static parameters = [[new OptionalMetadata(), Bar]];
constructor(bar){ }
}
var Foo = ng.core.
Injectable().
Class({
constructor: [
[new ng.core.OptionalMetadata(), Bar],
function(bar){
}
]
});
import {Component} from 'angular2/core';
import {Observable} from 'rxjs';
import {Store} from '@ngrx/store';
interface ITodoState{
todos: string[];
}
@Component({
selector: 'todo-list',
import {Component, Injectable, provide} from 'angular2/core';
abstract class AbstractTodoService{...}
@Injectable()
class TodoService extends AbstractTodoService{...}
@Component({
selector: 'todo-home',
viewProviders: [
import {
PLATFORM_DIRECTIVES,
provide,
bootstrap
} from 'angular2/core';
import {
ROUTER_PROVIDERS,
ROUTER_DIRECTIVES,
LocationStrategy,