当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript IQService.resolve方法代码示例

本文整理汇总了TypeScript中angular.IQService.resolve方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IQService.resolve方法的具体用法?TypeScript IQService.resolve怎么用?TypeScript IQService.resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular.IQService的用法示例。


在下文中一共展示了IQService.resolve方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

 (
   $controller: ng.IControllerService,
   $rootScope: ng.IRootScopeService,
   _$q_: IQService,
   applicationModelBuilder: ApplicationModelBuilder,
 ) => {
   application = applicationModelBuilder.createStandaloneApplication('app');
   $scope = $rootScope.$new();
   $q = _$q_;
   ctrl = $controller('ConfigurePipelineTemplateModalCtrl', {
     $scope,
     application,
     $uibModalInstance: { close: $q.resolve(null) },
     pipelineTemplateConfig: {
       config: {
         pipeline: {
           name: 'My Managed Pipeline',
           template: {
             source: 'spinnaker://myPipelineId',
           },
         },
       },
     },
     pipelineId: '1234',
     executionId: null,
     isNew: true,
   }) as ConfigurePipelineTemplateModalController;
 },
开发者ID:mizzy,项目名称:deck,代码行数:28,代码来源:configurePipelineTemplateModal.controller.spec.ts

示例2:

 loader: () =>
   $q.resolve([
     // Replica sets in same cluster, no manager.
     {
       name: 'replicaSet my-replicaSet-v002',
       region: 'default',
       category: 'serverGroup',
       account: 'my-k8s-account',
       cloudProvider: 'kubernetes',
       cluster: 'replicaSet my-replicaSet',
     },
     {
       name: 'replicaSet my-replicaSet-v001',
       region: 'default',
       category: 'serverGroup',
       account: 'my-k8s-account',
       cloudProvider: 'kubernetes',
       cluster: 'replicaSet my-replicaSet',
     },
     // Replica set managed by deployment.
     {
       name: 'replicaSet my-managed-replicaSet-v001',
       region: 'default',
       category: 'serverGroup',
       account: 'my-k8s-account',
       cloudProvider: 'kubernetes',
       cluster: 'deployment my-deployment',
       serverGroupManagers: [{ name: 'deployment my-deployment' }],
     },
   ]),
开发者ID:emjburns,项目名称:deck,代码行数:30,代码来源:ManifestCopier.spec.ts

示例3: getAllSecurityGroups

 public getAllSecurityGroups(): IPromise<ISecurityGroupsByAccountSourceData> {
   // Because these are cached in local storage, we unfortunately need to remove the moniker, as it triples the size
   // of the object being stored, which blows out our LS quota for a sufficiently large footprint
   const cache = this.infrastructureCaches.get('securityGroups');
   const cached = !!cache ? cache.get('allGroups') : null;
   if (cached) {
     return this.$q.resolve(cached);
   }
   return this.API.one('securityGroups').useCache().get()
     .then((groupsByAccount: ISecurityGroupsByAccountSourceData) => {
         Object.keys(groupsByAccount).forEach(account => {
           Object.keys(groupsByAccount[account]).forEach(provider => {
             Object.keys(groupsByAccount[account][provider]).forEach(region => {
               groupsByAccount[account][provider][region].forEach(group => {
                 delete group.moniker;
               })
             })
           })
         });
       if (cache) {
         cache.put('allGroups', groupsByAccount);
       }
       return groupsByAccount;
     });
 }
开发者ID:robfletcher,项目名称:deck,代码行数:25,代码来源:securityGroupReader.service.ts

示例4: fetchBasket

  fetchBasket(): IPromise<IBasket> {
    const basket = this.localStorageService.get('basket');

    if (basket) {
      return this.$q.resolve(basket);
    } else {
      return this.$q.reject({msg: 'No basket found in local storage'});
    }
  }
开发者ID:lunches-platform,项目名称:fe,代码行数:9,代码来源:basket.ts

示例5:

 loader: () =>
   $q.resolve([
     {
       name: 'myLoadBalancer',
       account: 'v2-k8s-account',
       cloudProvider: 'kubernetes',
       instances: [{ id: 'my-instance-id' }],
     },
   ]),
开发者ID:emjburns,项目名称:deck,代码行数:9,代码来源:skin.service.spec.ts

示例6: beforeEach

 beforeEach(() => {
   spyOn(SkinService, 'getAccounts').and.returnValue(
     $q.resolve([
       { name: 'v1-k8s-account', cloudProvider: 'kubernetes', skin: 'v1' },
       { name: 'v2-k8s-account', cloudProvider: 'kubernetes', skin: 'v2' },
       { name: 'appengine-account', cloudProvider: 'appengine', skin: 'v1' },
       { name: 'gce-account', cloudProvider: 'gce' },
     ]),
   );
 });
开发者ID:emjburns,项目名称:deck,代码行数:10,代码来源:skin.service.spec.ts

示例7: post

  post(url: string, data: any): IPromise<any> {
    var dataTable = this.database[url.replace(this.apiBase, '')];
    var dataRow = JSON.parse(data);
    var maxId = dataTable.length ? this.getMaxId(dataTable) : 0;

    dataRow.id = maxId + 1;
    dataTable.push(dataRow);

    return this.$q.resolve(dataRow);
  }
开发者ID:schuijers,项目名称:ng-forward-starter,代码行数:10,代码来源:in-memory-backend.service.ts

示例8: delete

  delete(url) {
    var urlParts = url.replace(this.apiBase, '').split('/');
    var dataTable = this.database[urlParts[0]];
    var index = dataTable.findIndex(row => row.id === parseInt(urlParts[1]));

    if (index > -1) {
      dataTable.splice(index, 1);
    }

    return this.$q.resolve();
  }
开发者ID:schuijers,项目名称:ng-forward-starter,代码行数:11,代码来源:in-memory-backend.service.ts


注:本文中的angular.IQService.resolve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。