當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript IRootScopeService.%24broadcast方法代碼示例

本文整理匯總了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
   });
 };
開發者ID:bhollis,項目名稱:DIM,代碼行數:7,代碼來源:dimMoveItemProperties.directive.ts

示例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 });
開發者ID:delphiactual,項目名稱:DIM,代碼行數:7,代碼來源:activity-tracker.directive.ts

示例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 });
        }
      });
    }
  });
}
開發者ID:delphiactual,項目名稱:DIM,代碼行數:33,代碼來源:destiny1.component.ts

示例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!();
 };
開發者ID:bhollis,項目名稱:DIM,代碼行數:8,代碼來源:item-tag.component.ts

示例5: if

 .then(() => {
   if (type === 'lock') {
     item.locked = state;
   } else if (type === 'track') {
     item.tracked = state;
   }
   $rootScope.$broadcast('dim-filter-invalidate');
 })
開發者ID:bhollis,項目名稱:DIM,代碼行數:8,代碼來源:dimMoveItemProperties.directive.ts

示例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 });
       }
     });
   }
 });
開發者ID:delphiactual,項目名稱:DIM,代碼行數:13,代碼來源:destiny1.component.ts

示例7:

 $rootScope.$applyAsync(() => {
   $rootScope.$broadcast('i18nextLanguageChange');
 });
開發者ID:delphiactual,項目名稱:DIM,代碼行數:3,代碼來源:settings.component.ts

示例8:

 intervalId = $interval(() => {
   // just start reloading stores more often
   $rootScope.$broadcast('dim-refresh');
 }, 60000);
開發者ID:delphiactual,項目名稱:DIM,代碼行數:4,代碼來源:d2farming.service.ts


注:本文中的angular.IRootScopeService.%24broadcast方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。