First of all, my back-end is using cakePHP 2.3 so I will like to have ajax way serialize all.
currently i have a form to test if serialize function working
//index
<http ng-app="app">...
<div ng-controller="appCtrl" ng-model='data'>...
<form ng-submit="helloWorld(this)" onsubmit="event.returnValue = false; return false;">
...</form><div></http>
//app.js
var app = angular.module('app', []);
app.controller("appCtrl", function($scope){
$scope.helloWorld = function(element){
console.log(element);
}
});
however it just return a bunch of item. tried $(element.target).serialize() but it cannot work. Finding an equivalent way of doing data: $(element.target).serialize() .
JsFiddle at http://jsfiddle.net/eX7fB/
version 2 for explain http://jsfiddle.net/eX7fB/1/
//index