本文整理匯總了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);