How to send form data from angularjs to grails controller action as params.

Lets look into the code through which one can send form data from angularjs using http service to grails end point.

var contentTypeConfig:{
  headers : {
      'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
  }
};

var data = {
description:"testing description"
};

$http.post(url,$.param(data),contentTypeConfig)
     .success(function(serviceResponse) {
            console.log("service response object",serviceResponse);
     })
     .error(function(err){
            console.log("error in the response", err);
     })

In the above code sample contentTypeConfig is used to set the content-type of the data to be send and $.param is used to send data with proper format to grails end point.