【发布时间】:2015-04-14 03:09:50
【问题描述】:
如果用户按下保存按钮,会发生如下逻辑:
Popup.notifyPopup($scope, "Saved...")
$location.path('/changeView');
Popup.notifyfyPopup 函数是将第二个参数中的消息设置到作用域中并在通知弹出窗口中通知消息的函数。
function notifyTopNotification(scope, msg) {
sharedProperties.setNotifyMsg(msg);
ngDialog.open({
template: 'notifyTopNotification',
controller: function() {4
$scope.notifyMsg = sharedProperties.getNotifyMsg();
},
className: 'ngdialog-close',
scope: $scope
});
setTimeout(1000);
};
notifyPopup : function(scope, msg) {
$scope = scope;
notifyTopNotification($scope, msg);
}
大多数情况下,它有效。但是 location.path() 后面的函数不起作用。因为 location.path() 函数改变了范围。我该怎么做?
【问题讨论】: