• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript angular-ui-bootstrap.IModalService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中angular-ui-bootstrap.IModalService的典型用法代码示例。如果您正苦于以下问题:TypeScript IModalService类的具体用法?TypeScript IModalService怎么用?TypeScript IModalService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1:

					authenticated: ["$uibModal", "authenticationModel",	($uibModal: IModalService, authenticationModel: AuthenticationModel): angular.IPromise<boolean> | boolean => {
						// Check if the user is authenticated
						if (!authenticationModel.isAuthenticated) {
							// Not authenticated, show the login modal
							return $uibModal.open({
								templateUrl: AuthenticationEditView,
								controller: "AuthenticationEditController",
								controllerAs: "vm",
								backdrop: "static",
								size: "sm"
							}).result.then((): boolean => authenticationModel.isAuthenticated).catch((): false => false);
						}

						// User is authenticated
						return true;
					}]
开发者ID:scottohara,项目名称:loot,代码行数:16,代码来源:states.ts


示例2: uniq

    return this.accountService.listProviders(application).then((providers) => {
      let provider;
      let reducedProviders: string[] = [];
      if (feature) {
        reducedProviders = providers.filter((p) => this.cloudProviderRegistry.hasValue(p, feature));
      }

      // reduce the providers to the smallest, unique collection taking into consideration the useProvider values
      reducedProviders = uniq(reducedProviders.map((providerName) => {
        const providerFeature = this.cloudProviderRegistry.getProvider(providerName)[feature] || {};
        return providerFeature.useProvider || providerName;
      }));

      if (reducedProviders.length > 1) {
        provider = this.$uibModal.open({
          templateUrl: require('./providerSelection.html'),
          controller: 'ProviderSelectCtrl as ctrl',
          resolve: {
            providerOptions: () =>  reducedProviders
          }
        }).result;
      } else if (reducedProviders.length === 1) {
        provider = this.$q.when(reducedProviders[0]);
      } else {
        provider = this.$q.when(SETTINGS.defaultProvider || 'aws');
      }
      return provider;
    });
开发者ID:jcwest,项目名称:deck,代码行数:28,代码来源:providerSelection.service.ts


示例3: filterFn

    return this.accountService.applicationAccounts(application).then((accounts: IAccountDetails[]) => {
      let reducedAccounts: IAccountDetails[] = [];
      if (feature) {
        reducedAccounts = accounts.filter(a => this.cloudProviderRegistry.hasValue(a.cloudProvider, feature));
      }

      if (filterFn) {
        reducedAccounts = reducedAccounts.filter((acc: IAccountDetails) => {
          return filterFn(application, acc, this.cloudProviderRegistry.getProvider(acc.cloudProvider, acc.providerVersion));
        });
      }

      // reduce the accounts to the smallest, unique collection taking into consideration the useProvider values
      const reducedProviders = uniq(reducedAccounts.map(a => {
        const providerFeature = this.cloudProviderRegistry.getProvider(a.cloudProvider)[feature] || {};
        return providerFeature.useProvider || a.cloudProvider;
      }));

      let provider;
      if (reducedProviders.length > 1) {
        provider = this.$uibModal.open({
          templateUrl: require('./providerSelection.html'),
          controller: 'ProviderSelectCtrl as ctrl',
          resolve: {
            providerOptions: () =>  reducedProviders
          }
        }).result;
      } else if (reducedProviders.length === 1) {
        provider = this.$q.when(reducedProviders[0]);
      } else {
        provider = this.$q.when(SETTINGS.defaultProvider || 'aws');
      }
      return provider;
    });
开发者ID:robfletcher,项目名称:deck,代码行数:34,代码来源:providerSelection.service.ts


示例4: editAccount

	public editAccount(accountType?: string, index?: number): void {
		// Helper function to sort by account name
		function byName(a: Account, b: Account): number {
			return a.name.localeCompare(b.name);
		}

		// Show the modal
		this.$uibModal.open({
			templateUrl: AccountEditView,
			controller: "AccountEditController",
			controllerAs: "vm",
			backdrop: "static",
			resolve: {
				account: (): Account | undefined => {
					let account: Account | undefined;

					// If we didn't get an index, we're adding a new account so just return null
					if (accountType && index && !isNaN(index)) {
						account = this.accounts[accountType].accounts[index];

						// Add the account to the LRU cache
						this.accountModel.addRecent(account);
					}

					return account;
				}
			}
		}).result.then((account: Account): void => {
			const currentAccountType: string = `${account.account_type.charAt(0).toUpperCase() + account.account_type.substring(1)} accounts`;

			if (!accountType || !index || isNaN(index)) {
				// Add new account to the end of the array
				this.accounts[currentAccountType].accounts.push(account);

				// Add the account to the LRU cache
				this.accountModel.addRecent(account);
			} else if (currentAccountType === accountType) {
				// Update the existing account in the array
				this.accounts[accountType].accounts[index] = account;
			} else {
				// If the edited account type has changed, remove the account from the original array
				this.accounts[accountType].accounts.splice(index, 1);

				// Recalculate the array total
				this.calculateAccountTypeTotal(accountType);

				// Add the account to the end of the new array
				this.accounts[currentAccountType].accounts.push(account);
			}

			// Resort the array
			this.accounts[currentAccountType].accounts.sort(byName);

			// Recalculate the array total
			this.calculateAccountTypeTotal(currentAccountType);
		});
	}
开发者ID:scottohara,项目名称:loot,代码行数:57,代码来源:index.ts


示例5: addLoadBalancer

 public addLoadBalancer(): void {
   this.$uibModal.open({
     templateUrl: require('./loadBalancerChoice.modal.html'),
     controller: `appengineLoadBalancerChoiceModelCtrl as ctrl`,
     resolve: {
       application: () => this.$scope.application,
     }
   }).result.then((newLoadBalancer: ILoadBalancer) => {
     this.$scope.stage.loadBalancers.push(newLoadBalancer);
   });
 }
开发者ID:jcwest,项目名称:deck,代码行数:11,代码来源:appengineEditLoadBalancerStage.ts


示例6:

		this.categoryModel.find(this.categories[index].id).then((category: Category): void => {
			// Disable navigation on the table
			this.ogTableNavigableService.enabled = false;

			let modalOptions: IModalSettings = {
				backdrop: "static"
			};

			// Check if the category has any transactions
			if (category.num_transactions > 0) {
				// Show an alert modal
				modalOptions = angular.extend({
					templateUrl: OgModalAlertView,
					controller: "OgModalAlertController",
					controllerAs: "vm",
					resolve: {
						alert: (): OgModalAlert => ({
							header: "Category has existing transactions",
							message: "You must first delete these transactions, or reassign to another category before attempting to delete this category."
						})
					}
				}, modalOptions);
			} else {
				// Show the delete category modal
				modalOptions = angular.extend({
					templateUrl: CategoryDeleteView,
					controller: "CategoryDeleteController",
					controllerAs: "vm",
					resolve: {
						category: (): Category => this.categories[index]
					}
				}, modalOptions);
			}

			// Show the modal
			this.$uibModal.open(modalOptions).result.then((): void => {
				// If the deleted category has a parent, decrement the parent's children count
				if (!isNaN(Number(this.categories[index].parent_id))) {
					// Find the parent category by it's id
					const parentIndex = this.categoryIndexById(this.categories[index].parent_id);

					// If found, decrement the number of children
					if (!isNaN(parentIndex)) {
						this.categories[parentIndex].num_children--;
					}
				}

				// Remove the category (and any children) from the array
				this.categories.splice(index, 1 + this.categories[index].num_children);

				// Go back to the parent state
				this.$state.go("root.categories");
			}).finally((): true => (this.ogTableNavigableService.enabled = true));
		});
开发者ID:scottohara,项目名称:loot,代码行数:54,代码来源:index.ts


示例7: addCustomHeader

 public addCustomHeader(): void {
   if (!this.stage.customHeaders) {
     this.stage.customHeaders = {};
   }
   this.$uibModal.open({
     templateUrl: require('./modal/addCustomHeader.html'),
     controller: 'WebhookStageAddCustomHeaderCtrl',
     controllerAs: 'addCustomHeader',
   }).result.then((customHeader: ICustomHeader) => {
     this.stage.customHeaders[customHeader.key] = customHeader.value;
   });
 }
开发者ID:jcwest,项目名称:deck,代码行数:12,代码来源:webhookStage.ts


示例8: editVip

 public editVip(cluster: any, vipType: 'oldVip' | 'newVip'): void {
   const clusterVip = this.stage.vipOverrides[this.getClusterId(cluster)];
   this.$uibModal.open({
     templateUrl: require('./editVip.modal.html'),
     controller: 'EditVipModalCtrl as vm',
     size: 'md',
     resolve: {
       vip: () => clusterVip[vipType]
     }
   }).result.then(newVip => {
     clusterVip[vipType] = newVip;
   });
 }
开发者ID:sghill,项目名称:deck,代码行数:13,代码来源:isolatedTestingTargetStage.ts


示例9:

 this.providerSelectionService.selectProvider(this.$scope.application).then((selectedProvider: string) => {
   let config = this.cloudProviderRegistry.getValue(selectedProvider, 'serverGroup');
   this.$uibModal.open({
     templateUrl: config.cloneServerGroupTemplateUrl,
     controller: `${config.cloneServerGroupController} as ctrl`,
     size: 'lg',
     resolve: {
       title: () => 'Add Isolated Testing Target Cluster',
       application: () => this.$scope.application,
       serverGroupCommand: () => this.buildServerGroupCommand(selectedProvider),
     }
   }).result.then((command: any) => this.applyCommandToStage(command));
 });
开发者ID:sghill,项目名称:deck,代码行数:13,代码来源:isolatedTestingTargetStage.ts


示例10: editPayee

	public editPayee(index?: number): void {
		// Helper function to sort by payee name
		function byName(a: Payee, b: Payee): number {
			return a.name.localeCompare(b.name);
		}

		// Disable navigation on the table
		this.ogTableNavigableService.enabled = false;

		// Show the modal
		this.$uibModal.open({
			templateUrl: PayeeEditView,
			controller: "PayeeEditController",
			controllerAs: "vm",
			backdrop: "static",
			resolve: {
				payee: (): Payee | null => {
					let payee: Payee | null = null;

					// If we didn't get an index, we're adding a new payee so just return null
					if (!isNaN(Number(index))) {
						payee = this.payees[Number(index)];

						// Add the payee to the LRU cache
						this.payeeModel.addRecent(payee);
					}

					return payee;
				}
			}
		}).result.then((payee: Payee): void => {
			if (isNaN(Number(index))) {
				// Add new payee to the end of the array
				this.payees.push(payee);

				// Add the payee to the LRU cache
				this.payeeModel.addRecent(payee);
			} else {
				// Update the existing payee in the array
				this.payees[Number(index)] = payee;
			}

			// Resort the array
			this.payees.sort(byName);

			// Refocus the payee
			this.focusPayee(payee.id);
		}).finally((): true => (this.ogTableNavigableService.enabled = true));
	}
开发者ID:scottohara,项目名称:loot,代码行数:49,代码来源:index.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap