Created
November 10, 2015 13:39
-
-
Save finalcut/2487635df0d1ff3ec410 to your computer and use it in GitHub Desktop.
Angular 1.x ES 6 Service using babel stage 0
This file contains 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
export default class ExampleService { | |
// you can do this in a controller as well. In fact, I do! | |
static $inject = ['$http']; | |
constructor($http) { | |
this.$http = $http; | |
} | |
// Example service function | |
getData () { | |
return this.$http({method: 'GET', url: './api' }); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment