How do i post data using Angularjs : I am new in Angularjs.I tried to post the form data.but it couldnot works.
My code is given below.



     var app = angular.module('myApp', []);
        // Controller function and passing $http service and $scope var.
        app.controller('myCtrl', function($scope, $http) {
          // create a blank object to handle form data.
            $scope.user = {};
          // calling our submit function.
            $scope.submitForm = function() {
            // Posting data to  file
            $http({
              method  : 'POST',
              url     : '/tokken/d/',
              data    : $scope.user, //forms user object
              headers : {'Content-Type': 'application/x-www-form-urlencoded'} 
             })
              .success(function(data) {
                if (data.errors) {
                  // Showing errors.
                  $scope.errorName = data.errors.name;
                  $scope.erroPassword = data.errors.password;
                  
                } else {
                  $scope.message = data.message;
                }
              });
            };
        });

please help me..