.controller('overviewCtrl', function ($scope, $http, $interval) {
$scope.cardShow = false;
$scope.infoShow = true;
$scope.yes1 = false;
$scope.yes2 = false;
$scope.status = true;
$scope.arbitration = true;
$scope.notAccepted = true;
$scope.cardShowRegular = false;
$scope.check1 = false;
$scope.id = 53;
$scope.opportunitiesArr = [];
$scope.opportunity = [];
$scope.profile = [];
/*getting opportunities*/
$scope.oppList = function() {
$http.get("https://serviceme.blynksystems.com:6443/createContract/fseoppurtunities/" + $scope.id)
.then(function (response) {
$scope.opportunitiesArr = response.data;
console.log("opportunities " + JSON.stringify($scope.opportunitiesArr));
}, function (response) {
console.log("error" + response);
});
}
/*$rootScope.$broadcast("sendOpportunities", $scope.opportunitiesArr);*/
$scope.oppList();
/*end of getting opportunities*/
$scope.contactInfo = function (opport) {
$scope.opportunity = opport;
console.log("opportfjdufiu" + JSON.stringify($scope.opportunity));
console.log("opport " + JSON.stringify(opport));
/*$scope.customerId = opport.customer_id;*/
/*$scope.serviceName = opport.service_name;
$scope.carModel = opport.car_model;*/
/*$scope.driverEmail = opport.driver_email;*/
/*$scope.statusOfFse = opport.status_of_fse;*/
$scope.cardShow = true;
$scope.cardShowRegular = true;
$scope.infoShow = false;
/*posting the acceptance*/
if (opport.driver_email != null || opport.driver_email != undefined) {
var data = {
"mechanic_id": $scope.id,
/*"customer_id": opport.customer_id,*/
"driver_email": opport.driver_email,
"service_name": opport.service_name,
"car_model": opport.car_model,
"status": 2,
"counter_price_fse": ""
}
} else {
var data = {
"mechanic_id": $scope.id,
"customer_id": opport.customer_id,
/*"driver_email": opport.driver_email,*/
"service_name": opport.service_name,
"car_model": opport.car_model,
"status": 2,
"counter_price_fse": ""
}
}
console.log("emergency" + JSON.stringify(data));
var req = {
method: 'POST',
url: 'https://serviceme.blynksystems.com:6443/createContract/updatewhenfseaccepted',
data: data
}
$http(req).then(function (response) {
console.log("respose" + JSON.stringify(response.data));
}, function (response) {
console.log(response);
});
$scope.callFtn = function() {
setInterval($scope.contactInfo(opport), 3000);
}
$scope.callFtn();
/*$interval(function() {
$scope.contactInfo(opport)
}, 3000);*/
/*posting the acceptance*/
}
});
をぶら下げている間に私は、イオンproject.Iに取り組んでいます私が使用していますserver.Forから来ている応答では5秒後にすべての状態を確認する必要がありますこの問題を解決するにはどうすればいいですか?
どんなエラーが発生しましたか? '$ interval'もうまくいくはずです。何かが失敗したように見える –
$ intervalも使用しましたが、contactInfo関数のiamはdivタグを1つ表示しています。 –