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


TypeScript core.AppViewManager类代码示例

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


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

示例1:

	ngAfterViewInit() {
		var propertySearchElement = this.viewManager.getNamedElementInComponentView(this.element, 'propertySearch');
		this.propertySearch = this.viewManager.getComponent(propertySearchElement);
		var addressParam = this.routeParams.get('address');
		if (addressParam) {
			this.propertySearch.searchTerm = addressParam;
		}
	}
开发者ID:Agilefreaks,项目名称:angular2_sample,代码行数:8,代码来源:search.ts

示例2: attachTemplatePortal

  attachTemplatePortal(portal: TemplatePortal): Promise<Map<string, any>> {
    let viewContainer = this._viewManager.getViewContainer(portal.templateRef.elementRef);
    let viewRef = viewContainer.createEmbeddedView(portal.templateRef);
    // TODO(jelbourn): locals don't currently work with DomPortalHost; investigate whether there
    // is a bug in Angular.
    portal.locals.forEach((v, k) => viewRef.setLocal(k, v));

    viewRef.rootNodes.forEach(rootNode => this._hostDomElement.appendChild(rootNode));

    this.setDisposeFn((() => {
      let index = viewContainer.indexOf(viewRef);
      if (index != -1) {
        viewContainer.remove(index);
      }
    }));

    // TODO(jelbourn): Return locals from view.
    return Promise.resolve(new Map<string, any>());
  }
开发者ID:9590,项目名称:material2,代码行数:19,代码来源:dom-portal-host.ts

示例3:

	ngAfterViewInit() {
		var modalElement = this.viewManager.getNamedElementInComponentView(this.element, 'modal');
		var propertySearchElement = this.viewManager.getNamedElementInComponentView(this.element, 'propertySearch');
		this.modal = this.viewManager.getComponent(modalElement);
		this.propertySearch = this.viewManager.getComponent(propertySearchElement);
	}
开发者ID:Agilefreaks,项目名称:angular2_sample,代码行数:6,代码来源:search.ts


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