Error: [$injector:undef] http://errors.angularjs.org/1.3.2/$injector/undef?p0=Verified
app.js (All)
var app = angular.module('myApp', ['ngRoute', 'ngResource']).config(['$routeProvider','$locationProvider','$controllerProvider','$httpProvider',
function($routeProvider, $locationProvider, $controllerProvider, $httpProvider) {
$controllerProvider.allowGlobals();
$routeProvider.when('/image',{
templateUrl: 'gallery',
controller: 'LoginController'
});
$routeProvider.when('/',{
templateUrl: 'gallery/oo',
controller: 'TodoController'
});
$routeProvider.when('/login',{
templateUrl: 'gal/login',
controller: 'TodoController'
});
$routeProvider.when('/ajax/login',{
templateUrl: 'ajax/login',
controller: 'TodoController'
});
$routeProvider.when('/recovery',{
templateUrl: 'gal/recovery',
controller: 'TodoController'
});
$routeProvider.when('/register',{
templateUrl: 'gal/register',
controller: 'TodoController'
});
$routeProvider.otherwise({redirectTo:'login'});
$locationProvider.hashPrefix('!');
}]);
function LoginController(){
alert('Login');
}
app.controller('TodoController', function($scope, $rootScope, $location, $http) {
$scope.aaa =100;
$scope.login = function() {
$location.path('/ajax/login');
/* $http.post('/ajax/login').success(function(response)
{
}); */
// alert('Todo');
};
});
app.factory('Verified',['$rootScope', function($rootScope){
function auth(answer_server){
if(answer_server.access=='no') return false;
else return true;
}
}]);
app.directive('onBlur', ['$http', '$location', 'Verified', function($http, $location, Verified) {
return {
restrict: 'A',
link: function(scope, elm, attrs) {
elm.bind('blur', function(eld) {
var login = scope.loginmy;
var password = scope.passwordmy;
var log = 'UserLogin[username]';
var pass = 'UserLogin[password]';
$http.post('/gal/loginvalidate', {'ajax': 'form-login',
'UserLogin[username]':login,'UserLogin[password]':password}).success(function(data, status, headers, config) {
});
});
}
};
}]);