本文整理汇总了TypeScript中angular.IRootScopeService.%24broadcast方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IRootScopeService.%24broadcast方法的具体用法?TypeScript IRootScopeService.%24broadcast怎么用?TypeScript IRootScopeService.%24broadcast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular.IRootScopeService
的用法示例。
在下文中一共展示了IRootScopeService.%24broadcast方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
vm.openCompare = () => {
ngDialog.closeAll();
$rootScope.$broadcast('dim-store-item-compare', {
item: vm.item,
dupes: true
});
};
示例2:
const refresh = _.throttle(() => {
// Individual pages should listen to this event and decide what to refresh,
// and their services should decide how to cache/dedup refreshes.
// This event should *NOT* be listened to by services!
// TODO: replace this with an observable?
$rootScope.$broadcast('dim-refresh');
}, ONE_MINUTE, { trailing: false });
示例3: Destiny1Controller
function Destiny1Controller(
this: IController,
$rootScope: IRootScopeService,
hotkeys,
$scope: IScope,
$i18next
) {
'ngInject';
hotkeys = hotkeys.bindTo($scope);
hotkeys.add({
combo: ['i'],
description: $i18next.t('Hotkey.ToggleDetails'),
callback() {
$rootScope.$broadcast('dim-toggle-item-details');
}
});
itemTags.forEach((tag) => {
if (tag.hotkey) {
hotkeys.add({
combo: [tag.hotkey],
description: $i18next.t('Hotkey.MarkItemAs', {
tag: $i18next.t(tag.label)
}),
callback() {
$rootScope.$broadcast('dim-item-tag', { tag: tag.type });
}
});
}
});
}
示例4:
vm.updateTag = () => {
vm.item.dimInfo.tag = vm.selected.type;
if (!vm.item.dimInfo.tag) {
delete vm.item.dimInfo.tag;
}
$rootScope.$broadcast('dim-filter-invalidate');
vm.item.dimInfo.save!();
};
示例5: if
.then(() => {
if (type === 'lock') {
item.locked = state;
} else if (type === 'track') {
item.tracked = state;
}
$rootScope.$broadcast('dim-filter-invalidate');
})
示例6: callback
itemTags.forEach((tag) => {
if (tag.hotkey) {
hotkeys.add({
combo: [tag.hotkey],
description: $i18next.t('Hotkey.MarkItemAs', {
tag: $i18next.t(tag.label)
}),
callback() {
$rootScope.$broadcast('dim-item-tag', { tag: tag.type });
}
});
}
});
示例7:
$rootScope.$applyAsync(() => {
$rootScope.$broadcast('i18nextLanguageChange');
});
示例8:
intervalId = $interval(() => {
// just start reloading stores more often
$rootScope.$broadcast('dim-refresh');
}, 60000);