Public agreement
// contains the information passed in, and the status of this page $scope. pagestate = { edittype: $location. Search (). EditType,// value range: Modify, Create ismodify: ($location. Search (). EditType = = "Modify") ,= = "Modify")? ' Put ': ' Post ', ID: $location. Search (). ID, };
Angular
//Execution$http ({method:' Get ', URL:"/handlerapi.getapijson.tclywork?" Apipath=test/get ", params: {OrgName:curElement.val ()}, headers: {' Content-type ': ' application/x-www-form-urlencoded '}}). Success (function(data, status, headers, config) {if(Data.code = = 200) {$scope. companylist=Data.data; }}). Error (function(data, status, headers, config) {});
//Execution$http ({method: $scope. Pagestate.method,//' Get ',URL: "/handlerapi.getapijson.tclywork?" Apipath=test/get ", params: $scope. modelorg, headers: {' Content-type ': ' application/x-www-form-urlencoded '}}). Success (function(data, status, headers, config) {if(Data.code = = 200) {$scope. modelorg=Data.data; }}). Error (function(data, status, headers, config) {});
Jquery
vartimestamp =NewDate (). GetTime (); vardata =NewFormData (); Data.append ("File", files); Data.append ("Key", timestamp); //data.append ("token", $scope. Uptoken);$.ajax ({data:data, type:"POST", URL:"/handlerapi.getapijson.tclywork?" apipath=upload/post&client_id=ba1deb01b25f4620ae04904daefed646 ", Cache:false, ContentType:false, ProcessData:false, Success:function(data) {Console.log ("Success:"); Console.log (data); varOData =json.parse (data); Console.log (OData); if(Odata.code = = 200) {console.log (Odata.code); varURL =Odata.data.AssetUrl; varfilename =Odata.data.AssetName; $(". Summernote"). Summernote (' insertimage ', url, filename);//This solution does not conform to the angular style, the insertion of nodes //var editor = $.summernote.eventhandler.getmodule (); //editor.insertimage ($scope. summernote.editable, $scope. Prefix + '/' + Data.key); } Else{console.log (odata.msg); }; }, Error:function() {Console.log ("Failed:") } });
Angular>> $http and jquery>>$. Ajax comparison