如何在AngularJS中發送這些數據。 (這是在多陣列的多陣列,需要發送一個對象)在Angular js中發送多個數組的多個數組
[{
"working_day":"sunday",
"from_time":{"hour":"9","min":"30"},
"to_time":{"hour":"6","min":"30"}
},{
"working_day":"monday",
"from_time":{"hour":"9","min":"30"},
"to_time":{"hour":"6","min":"30"}... and so on for other week days
}]
我試圖在API中發送數據,這樣,我是新來AngularJs,所以請告訴我,我該怎麼做這些數據在運行時通過HTML?
$scope.schedule = []; // Hard coded value
$scope.week = {};
$scope.week.working_day = "Sunday";
$scope.week.from_time = {};
$scope.week.from_time.min = "10:00";
$scope.week.from_time.max = "5:00";
$scope.week.to_time = {};
$scope.week.to_time.min = "2:10";
$scope.week.to_time.max = "8:00";
var dataParam = {
"prefix":$scope.data1.prefix,
"first_name":$scope.data1.first_name,
"password":$scope.data1.password,
"last_name":$scope.data1.last_name,
"email_id":$scope.data1.email_id,
"mobile_number":$scope.data1.mobile_number,
"roleCode":[$scope.data1.roleCode],
"role":[$scope.data1.role],
"Schedule":angular.toJson($scope.schedule.push($scope.week))
}
console.log(angular.toJson(dataParam));
/* $http({
url: "/here",
method: "POST",
headers :{'Content-Type': 'application/json','Accept': 'application/json' },
data: dataParam
}) .success(function(response) {
if(response.status_code=="success")
{
$scope.successmsg = response.status_message;
console.log(angular.toJson(response));
$state.go('dashboard.setting.user', {'user': $scope.viewUser});
}
else {
$scope.successmsg = response.status_code;
}
}); */
};
現在我只需要具有角JS發送這個數據格式,請建議
這是我在角由「硬編碼」做我需要發送的角度JS這個數據,我怎麼能去做?
現在,請幫助我的角度HTML代碼的用戶到該硬編碼值發送到運行值
你想從angularjs發送數據或想要使用angularjs顯示這些數據? –
發送並取回相應的 – adasdasd
是否要在HTML中顯示此數據? –