0
我的AngularJS应用程序中有一个通知下拉列表。我想在打开下拉列表的函数中调用一个函数。这里是我的意思是:函数内的AngularJS函数
$scope.showNotif = false;
$scope.toggleNotifDropdown = function(event) {
$scope.showNotif = !$scope.showNotif;
readNotifications = function() {
NotificationService.readNotifs().then(
function(success) {
console.log("Notifications read!");
},
function(errors) {
console.log("Something wrong happened.");
}
);
};
if($scope.showNotif) {
$document.bind('click', $scope.globalNotifClose);
} else {
$document.unbind('click', $scope.globalNotifClose);
}
event.stopPropagation();
};
的通知下拉完美的作品,我只是无法得到该功能readNotifications()为我工作。任何建议都会很棒!谢谢!
你是否曾经调用'readNotifications()'? – ryanyuyu