I changed a project in my company and changed $.ajax in JQuery to $http in AngularJS. When submitting data, it used to be $("#form").serialize(), but now to submit data, I need to List them all and encapsulate them into json for submission. I just want to ask if there is a way in angularjs to submit all the form data at once like the former. (PS: The company requires not to use JQuery in the project)
Get the object by naming it
ng-model
在controller
中直接使用$scope.user
as above.Specify the name attribute for the form element, and then the form will define a form controller with this name in the scope where it is located.
For example
Then use the following operations to get the value