Skip to content

Instantly share code, notes, and snippets.

@MikeRyanDev
Last active January 19, 2016 02:49
Show Gist options
  • Save MikeRyanDev/71612ce61cb8e013767a to your computer and use it in GitHub Desktop.
Save MikeRyanDev/71612ce61cb8e013767a to your computer and use it in GitHub Desktop.
import {Component, Injectable, provide} from 'angular2/core';
abstract class AbstractTodoService{...}
@Injectable()
class TodoService extends AbstractTodoService{...}
@Component({
selector: 'todo-home',
viewProviders: [
provide(AbstractTodoService, { useClass: TodoService })
],
template: `...`
})
class TodoHome{
constructor(todoService: AbstractTodoService){ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment