4 ms·
Because .factory is slightly more general (can return non-objects), and it can't be called .service because backward compatibility.
by spion 13y ago
Because .factory is slightly more general (can return non-objects), and it can't be called .service because backward compatibility.
- jonny_eh 13y agoThe article seems to be down for me. Can you give an example of a case where a .service won't cut it but a . Factory would?
- minznerjosh 13y ago.factory('$timeout', function($window) { var $timeout = $window.setTimeout; return $timeout; }) .service('$timeout', function($window) { // $timeout is a function, not an normal object. Why would I use a constructor //function to provide it? });
- alttab 13y agoI want the bike shed to be blue, god dammit!