Created
April 23, 2017 03:08
-
-
Save scottadamsmith/a577a5b8ff785ee868accf87ca6ad6a2 to your computer and use it in GitHub Desktop.
ES6 imports w/ ES5 Angular service
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
import SampleModule from 'modules/some.module'; | |
angular.module('main-app', [SampleModule]) | |
.run(); |
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
import sampleService from 'services/some.service'; | |
export default angular.module('some-module', []) | |
.service('sampleService', sampleService) | |
.name; |
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 function sampleService ($q) { | |
this.sampleServiceValue = 'sampleServiceValue'; | |
}; | |
sampleService.$inject = ['$q']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment