Skip to content

Instantly share code, notes, and snippets.

@elgervb
Last active April 6, 2016 14:10
Show Gist options
  • Save elgervb/dfe4acf0c34002f0022c8d600db3853e to your computer and use it in GitHub Desktop.
Save elgervb/dfe4acf0c34002f0022c8d600db3853e to your computer and use it in GitHub Desktop.
TypeScript angular 1.5 Component
class MyComponentController {
static $inject = ['AnyService'];
constructor( private service: AnyService) {}
}
class MyComponent implements ng.IComponentOptions {
public bindings: { [binding: string]: string };
public controller: string | Function;
public templateUrl: string | Function;
constructor() {
this.bindings = {};
this.controller = MyComponentController;
this.templateUrl = '/tpl/mycomponent.html';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment