當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。