Hi All
I am new to AngularJS and good experience in Rails. I am developing an
application with Rails and Angular. Now I struck with angular JS testing. I
am using Jasmine to do using testing. Here is my controller:
// factory
myApp.factory('User', ['$resource', function($resource){
return $resource('/users/:id.json', {}, {
show: { method: 'GET' },
update: { method: 'PUT', params: {id: '@id'} },
delete: { method: 'DELETE', params: {id: '@id'} }
});
}])
// controller
myApp.controller("UserUpdateCtr", ['$scope', '$resource', 'User',
'$location', '$routeParams', function($scope, $resource, User, $location,
$routeParams) {
$scope.user = User.get({id: $routeParams.id})
$scope.update = function(){
if ($scope.userForm.$valid){
User.update($scope.user,function(){
$location.path('/');
}, function(error) {
console.log(error)
});
}
};
}]);
I searched on Google but I didn't find a way to test above code? Could you
help? Thanks in advance.
--
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.