title: Cannot POST using Angular JS
body: <p>Hi I am trying to post data with AnguarJs but having some issues.My js code is below :</p>
  
  <pre><code>    var app = angular.module('myApp', []);
      app.constant('appUrl', 'http://localhost/zara/rest/');
   /*---- categories fetch code  -------*/  
      app.controller('myController',['$scope','$http','appUrl',  function($scope, $http , appUrl) {
  
        $scope.newName = "";
      $scope.postForm = function() {  
          var data = $.param({
                  name: $scope.newName
              });
  
          $http.post("http://localhost/zara/rest/api_customerlogin.php", data).success(function(data, status) {
              $scope.hello = data;
              console.log(data);
          });
       };
    }]);
  </code></pre>
  
  <p>I am getting this error <code>TypeError: Cannot read property 'param' of undefined</code> And when i change code to like this one then i got this error.</p>
  
  <pre><code>&lt;script&gt;
      angular.module('myApp', [])
      .controller('myController', ['$scope', '$http', function($scope, $http) {
          this.loginForm = function() {
  
              var user_data='user_email=' +this.inputData.email+'&amp;user_password='+this.inputData.password;
  
              $http({
                  method: 'POST',
                  url: 'login.php',
                  data: user_data,
                  headers: {'Content-Type': 'application/x-www-form-urlencoded'}
              })
              .success(function(data) {
          console.log(data);
  
              })
          }
  
      }]);
      &lt;/script&gt;
  </code></pre>
  
  <p>Cannot post to login.html page.This is my first project on AnguarJs so not very familer with this.Thanks.</p>