I mm新增AngularJS。我有以下AngularJS代碼。我想在重定向代碼之前添加一些延遲。任何幫助,將不勝感激。AngularJS延遲
if(data.status=='success')
{
$scope.succ = "success";
var sessionid=data.doctor.doctor_id;
/*------------------------------------*/
/* How to add delay (3 seconds) here */
/*------------------------------------*/
$window.location.href = 'http://localhost:8099/medical-web/login?essionid='+sessionid+'';
}
您可以使用JS函數'setTimeout'爲同一 –