Erro in Injection


#1

An error occurs when I inject the method createUser.

What can it be?

.controller(‘CadastroController’, [’$scope’, ‘createUser’, function ($scope,createUser) {
$scope.msgtxt=’’;
$scope.cadastro = function(data){
alert(‘test’);
};
}])


angular.module(‘starter.createUser’)

.factory(‘createUser’,function($http, $location){
return{
create:function(data,scope){
alert(data);
}
}

});

Error: [$injector:unpr] http://errors.angularjs.org/1.2.12/$injector/unpr?p0=createUserProvider%20<-%20createUser
t/<@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:37
Yb/l.$injector<@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:63
c@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:61
Yb/p.$injector<@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:63
c@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:61
d@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:61
Yb/g/<.instantiate@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:62
id/this.$get</<@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:93
d@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:326
a.compile/</b@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:326
Ad/this.$get</h.prototype.$broadcast@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:136
q/s/v.transitionTo/v.transition<@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:303
zd/e/l.promise.then/A@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:124
zd/g/<.then/<@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:125
Ad/this.$get</h.prototype.$eval@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:133
Ad/this.$get</h.prototype.$digest@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:131
Ad/this.$get</h.prototype.$apply@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:134
f@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:98
H@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:102
od/</C.onreadystatechange@http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js:103

http://localhost/Project/ProjectMobile/ProjectAndroid/www/lib/ionic/js/ionic.bundle.min.js
Line 116


#2

Can you post a codepen demo?