Skip to content

Instantly share code, notes, and snippets.

@albulescu
Last active July 13, 2016 13:58
Show Gist options
  • Save albulescu/82ad75f9f478631734961a0d239b016a to your computer and use it in GitHub Desktop.
Save albulescu/82ad75f9f478631734961a0d239b016a to your computer and use it in GitHub Desktop.
Ng 1.5 to 2 component standard
# Angular 1.5
class Button {
constructor( $http ) {
this.http = $http;
}
}
angular.module('x').component('xbutton', {
...,
controller: Button
});
# Angular 2
@Component({
...,
selector:'xbutton'
})
class Button {
constructor( private http:Http ) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment