Last active
July 13, 2016 13:58
-
-
Save albulescu/82ad75f9f478631734961a0d239b016a to your computer and use it in GitHub Desktop.
Ng 1.5 to 2 component standard
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
# 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