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


TypeScript IScope.%24on方法代碼示例

本文整理匯總了TypeScript中angular.IScope.%24on方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IScope.%24on方法的具體用法?TypeScript IScope.%24on怎麽用?TypeScript IScope.%24on使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angular.IScope的用法示例。


在下文中一共展示了IScope.%24on方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

  public $onInit(): void {
    const { $scope, $rootScope, $timeout, app } = this;
    const filterModel = ClusterState.filterModel.asFilterModel;

    this.sortFilter = filterModel.sortFilter;
    this.tags = filterModel.tags;
    this.groupsUpdatedSubscription = ClusterState.filterService.groupsUpdatedStream.subscribe(
      () => (this.tags = filterModel.tags),
    );

    if (app.serverGroups.loaded) {
      this.initialize();
    }

    app.serverGroups.onRefresh($scope, () => this.initialize());
    this.locationChangeUnsubscribe = $rootScope.$on('$locationChangeSuccess', () => {
      $timeout(() => {
        filterModel.activate();
        ClusterState.filterService.updateClusterGroups(app);
      });
    });

    $scope.$on('$destroy', () => {
      this.groupsUpdatedSubscription.unsubscribe();
      this.locationChangeUnsubscribe();
    });
  }
開發者ID:mizzy,項目名稱:deck,代碼行數:27,代碼來源:clusterFilter.component.ts

示例2:

  public $onInit(): void {
    const { loadBalancerFilterModel, loadBalancerFilterService, app, $scope, $rootScope } = this;
    const filterModel = loadBalancerFilterModel.asFilterModel;

    this.tags = filterModel.tags;
    this.groupsUpdatedSubscription = loadBalancerFilterService.groupsUpdatedStream
      .subscribe(() => {
        // need to applyAsync because everything else is happening in React now; will replicate when converting clusters, etc.
        $scope.$applyAsync(() => this.tags = filterModel.tags);
      });

    if (app.loadBalancers && app.loadBalancers.loaded) {
      this.initialize();
    }

    app.loadBalancers.onRefresh($scope, () => this.initialize());

    this.locationChangeUnsubscribe = $rootScope.$on('$locationChangeSuccess', () => {
      filterModel.activate();
      loadBalancerFilterService.updateLoadBalancerGroups(app);
    });

    $scope.$on('$destroy', () => {
      this.groupsUpdatedSubscription.unsubscribe();
      this.locationChangeUnsubscribe();
    });

  }
開發者ID:robfletcher,項目名稱:deck,代碼行數:28,代碼來源:loadBalancer.filter.component.ts

示例3:

  public $onInit(): void {
    const { $scope, $rootScope, app, SecurityGroupFilterModel, securityGroupFilterService } = this;

    this.sortFilter = SecurityGroupFilterModel.sortFilter;
    this.tags = SecurityGroupFilterModel.tags;

    $scope.$on('$destroy', $rootScope.$on('$locationChangeSuccess', () => {
      SecurityGroupFilterModel.activate();
      securityGroupFilterService.updateSecurityGroups(app);
    }));

    this.initialize();
    app.securityGroups.onRefresh($scope, () => this.initialize());
  }
開發者ID:brujoand,項目名稱:deck,代碼行數:14,代碼來源:securityGroup.filter.component.ts

示例4: function

  controller: function(
    $window: IWindowService,
    $scope: IScope,
    $state: StateService,
    $rootScope: IScope) {
    'ngInject';
    const reduceModeKey = 'gv-sidenav-reduce-mode';
    this.$window = $window;
    this.reducedMode = false;

    this.$onInit = () => {
      if (this.$window.localStorage.getItem(reduceModeKey) !== null) {
        this.reducedMode = JSON.parse(this.$window.localStorage.getItem(reduceModeKey));
      }
    };

    this.toggleReducedMode = () => {
      this.reducedMode = !this.reducedMode;
      $window.localStorage.setItem(reduceModeKey, this.reducedMode);
      $rootScope.$broadcast('onWidgetResize');
    };

    this.isActive = function (menuItem) {
      let menuItemSplitted = menuItem.name.split('.');
      let currentStateSplitted = $state.current.name.split('.');
      return menuItemSplitted[0] === currentStateSplitted[0] &&
        menuItemSplitted[1] === currentStateSplitted[1];
    };

    $scope.$on('reduceSideNav', () => {
      if (!this.reducedMode) {
        this.toggleReducedMode();
      }
    });
  }
開發者ID:gravitee-io,項目名稱:gravitee-management-webui,代碼行數:35,代碼來源:sidenav.component.ts

示例5:

  public $onInit(): void {
    const { LoadBalancerFilterModel, loadBalancerFilterService, app, $scope, $rootScope } = this;

    this.tags = LoadBalancerFilterModel.tags;

    if (app.loadBalancers.loaded) {
      this.initialize();
    }

    app.loadBalancers.onRefresh($scope, () => this.initialize());

    $scope.$on('$destroy', $rootScope.$on('$locationChangeSuccess', () => {
      LoadBalancerFilterModel.activate();
      loadBalancerFilterService.updateLoadBalancerGroups(app);
    }));
  }
開發者ID:brujoand,項目名稱:deck,代碼行數:16,代碼來源:loadBalancer.filter.component.ts

示例6: D2InventoryController

function D2InventoryController(
  this: IController & {
    account: DestinyAccount;
  },
  $scope: IScope,
  D2StoresService: StoreServiceType
) {
  'ngInject';

  const vm = this;

  this.$onInit = () => {
    getBuckets().then((buckets) => {
      vm.buckets = buckets;
      subscribeOnScope($scope, D2StoresService.getStoresStream(vm.account), (stores) => {
        if (stores) {
          vm.stores = stores;
        }
      });
    });
  };

  $scope.$on('dim-refresh', () => {
    D2StoresService.reloadStores();
  });
}
開發者ID:delphiactual,項目名稱:DIM,代碼行數:26,代碼來源:d2-inventory.component.ts

示例7: VendorsController

function VendorsController(
  this: IController & {
    account: DestinyAccount;
    settings: typeof settings;
  },
  $scope: IScope
) {
  'ngInject';

  const vm = this;

  vm.activeTab = 'hasArmorWeaps';
  vm.activeTypeDefs = {
    armorweaps: ['armor', 'weapons'],
    vehicles: ['ships', 'vehicles'],
    shadersembs: ['shaders', 'emblems'],
    emotes: ['emotes']
  };

  vm.settings = settings;

  this.$onInit = () => {
    subscribeOnScope($scope, dimVendorService.getVendorsStream(vm.account), ([stores, vendors]) => {
      vm.stores = stores;
      vm.vendors = vendors;
      vm.totalCoins = dimVendorService.countCurrencies(stores, vendors);
      dimVendorService.requestRatings().then(() => $scope.$apply());
    });
  };

  $scope.$on('dim-refresh', () => {
    dimVendorService.reloadVendors();
  });
}
開發者ID:bhollis,項目名稱:DIM,代碼行數:34,代碼來源:vendors.component.ts

示例8:

  public $onInit(): void {
    const { $scope, $rootScope, ClusterFilterModel, clusterFilterService, app } = this;

    this.sortFilter = ClusterFilterModel.sortFilter;
    this.tags = ClusterFilterModel.tags;

    if (app.serverGroups.loaded) {
      this.initialize();
    }

    app.serverGroups.onRefresh($scope, () => this.initialize());

    $scope.$on('$destroy', $rootScope.$on('$locationChangeSuccess', () => {
      ClusterFilterModel.activate();
      clusterFilterService.updateClusterGroups(app);
    }));
  }
開發者ID:brujoand,項目名稱:deck,代碼行數:17,代碼來源:clusterFilter.component.ts

示例9: constructor

  constructor ($scope: IScope, $element: IAugmentedJQuery, event: string, fn: any) {
    this.$element = $element
    this.event = event
    this.fn = fn

    $scope.$on('$destroy', () => {
      this.$element.unbind(this.event, this.fn)
    })
  }
開發者ID:angular-gantt,項目名稱:angular-gantt,代碼行數:9,代碼來源:smartEvent.factory.ts

示例10:

export function subscribeOnScope<T>(
  $scope: IScope,
  observable: Observable<T>,
  subscribeFn: (T) => void
): Subscription {
  const subscription = observable.subscribe(subscribeFn);
  $scope.$on('$destroy', () => subscription.unsubscribe());
  return subscription;
}
開發者ID:bhollis,項目名稱:DIM,代碼行數:9,代碼來源:rx-utils.ts


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