跳到主要內容
搜尋
搜尋此網誌
弘弘的部落格
分享
取得連結
Facebook
X
Pinterest
以電子郵件傳送
其他應用程式
標籤
angularjs
7月 31, 2020
使用 $timeout 注意
$scope destroy 時要 cancel,因為不會自動取消呼叫,若固定周期呼叫則會持續呼叫
$scope.timer = $timeout($scope.onTimeout, 10000);
$scope.$on(
"$destroy",
function (event) {
$timeout.cancel($scope.timer);
}
);
留言
熱門文章
5月 07, 2016
讓chrome 自動開啟檔案且不要下載
7月 06, 2018
epplus 用法
留言