当前位置: 首页>>代码示例>>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;未经允许,请勿转载。