Created
March 20, 2015 05:43
-
-
Save ketanghumatkar/4586d9715479c163c4c0 to your computer and use it in GitHub Desktop.
AngularJS Factory Snippet
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
// Factory can have another factory, $rootScope as dependancy but not $scope | |
Sample.factory('SampleFactory', ['$window', '$rootScope', 'AnotherFactory', function (_, $window, $rootScope, AnotherFactory) { | |
var factory = {} | |
factory.method1 = function() {}; | |
factory.method2 = function() {}; | |
return factory; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment