var mainApp = angular.module("mainApp", ['ngRoute','ngGrid']);
mainApp.config(function($routeProvider) {
$routeProvider
.when('/admin', {
templateUrl: 'admin.html',
controller: 'dbaController'
}).when('/user',{
templateUrl : 'user.html',
controller : 'userController'
}).otherwise({
redirectTo: '/index.html'
});
});
mainApp.controller('indexController', function($scope,$location,$http) {
$scope.submit = function(user) {
$scope.userList=[{id : ' ' } , {name : ' ' } , { password : ' '} ];
$http.get('/allUsers').success(function(data){
for(var i = 0 ; i<data.length ; i++){
userList=data[i];
for(var j = 0;j<userList.length ; j++){
if(userList.name == user.name && userList.password ==
user.password)
location.path('/user');
}
}
});
}
});
I have user model containing name and password in front-end as angular code
and user table in my db . I want to route user page if , user.name and
user.password are correct but i couldn't figure out java list how to splice
in angular.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.