@MohammedSalah wrote:
Hello,
How i redirect to another How to redirect to a another view after successful save ng-submit formafter successful post
.factory('Post', function($resource) { return $resource(api/add_new_order',{name: "@name", phone: "@phone", address: "@address",problem: "@problem", device: "@device", price: "@price"}); }) .controller('ContactCtrl', function($scope, Post, Authorization) { // Get all posts $scope.posts = Post.query(); // Our form data for creating a new post with ng-model $scope.postData = {}; $scope.newPost = function() { var post = new Post($scope.postData); post.$save(); } $scope.issues = {}; $scope.answer = function(){ console.log($scope.issues.name); } $scope.postData = Authorization; })
Posts: 4
Participants: 2