本文整理汇总了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;
},
示例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' }],
},
]),
示例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;
});
}
示例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'});
}
}
示例5:
loader: () =>
$q.resolve([
{
name: 'myLoadBalancer',
account: 'v2-k8s-account',
cloudProvider: 'kubernetes',
instances: [{ id: 'my-instance-id' }],
},
]),
示例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' },
]),
);
});
示例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);
}
示例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();
}