This answer (and numerous others) point out that .factory and .service are distinct convenience functions over the provider() functionality.
However, I don't see any distinction between a .service() and a .factory() call (ie: the tests below pass). Can someone help me understand what I'm missing. thanks
angular.module('myMod', [])
.service('myService', function() {
return function() {return 33};
})
.factory('myFactory', function() {
return function() {return 33};
});
describe('my app tests', function() {
beforeEach(module('myMod'));
it('services should work', inject(function(myService) {
expect(myService()).to.equal(33);
}));
it('factories should work', inject(function(myFactory) {
expect(myFactory()).to.equal(33);
}));
});