Skip to content

Instantly share code, notes, and snippets.

@RhinoLance
Created March 22, 2014 05:17
Show Gist options
  • Save RhinoLance/9701636 to your computer and use it in GitHub Desktop.
Save RhinoLance/9701636 to your computer and use it in GitHub Desktop.
//This doesn't work. The test can't find the service
angular.module('RhinoLib').service('sqLite', function( $q ) {
this.initPromise = null;
this.oDb = null;
}
//This works perfectly. I just renoved the $q parameter for the service
angular.module('RhinoLib').service('sqLite', function() {
this.initPromise = null;
this.oDb = null;
}
describe('Service sqLite test', function(){
describe('When I try to inject it', function(){
it('gets the service', function(){
var $injector = angular.injector([ 'RhinoLib' ]);
var myService = $injector.get( 'sqLite' );
expect( myService).not.toBe(null);
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment