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


TypeScript core.QueryList类代码示例

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


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

示例1: generateGroupOption

function generateGroupOption(label: string, value: NzOptionComponent[]): NzOptionGroupComponent {
  const optionGroup = new NzOptionGroupComponent();
  const queryList = new QueryList<NzOptionComponent>();
  queryList.reset(value);
  optionGroup.listOfNzOptionComponent = queryList;
  optionGroup.nzLabel = label;
  return optionGroup;
}
开发者ID:SrgGs,项目名称:ng-zorro-antd,代码行数:8,代码来源:nz-option.pipe.spec.ts

示例2: beforeEach

    beforeEach(function() {
        multiAlertService = new MultiAlertService();

        TestBed.configureTestingModule(
            {imports: [ClrEmphasisModule], providers: [{provide: MultiAlertService, useValue: multiAlertService}]});

        alert = TestBed.createComponent(ClrAlert);
        anotherAlert = TestBed.createComponent(ClrAlert);

        queryList = new QueryList<ClrAlert>();
        queryList.reset([alert.componentInstance, anotherAlert.componentInstance]);

        multiAlertService.manage(queryList);
    });
开发者ID:beqom,项目名称:clarity,代码行数:14,代码来源:multi-alert.service.spec.ts

示例3: highlightItem

    private highlightItem(item:CalendarItem | undefined):void {
        if (item) {
            this._renderedItems.forEach(i => i.hasFocus = false);
            const rendered = this._renderedItems.find(ri => ri.item === item);
            if (rendered && !rendered.hasFocus) {
                rendered.hasFocus = true;
                rendered.changeDetector.detectChanges();
            }

            this._highlightedItem = item;
        }
    }
开发者ID:edcarroll,项目名称:ng2-semantic-ui,代码行数:12,代码来源:calendar-view.ts

示例4:

	saveAll() {
		var allInputs: GenericPropertyEditorComponent[] = [];

		allInputs = allInputs.concat(
			this.audioPropertyInputs.toArray(),
			this.imagePropertyInputs.toArray(),
			this.textPropertyInputs.toArray()
		);
		allInputs.forEach((input) => {
			input.save();
		});
	}
开发者ID:deciare,项目名称:flowerbox-web-angular,代码行数:12,代码来源:property-editor.component.ts

示例5: loadTabs

    // Connects tab headers to tab contents, and creates a tab instance for each pairing.
    private loadTabs():void {
        // Remove any tabs that no longer have an associated header.
        this.tabs = this.tabs.filter(t => !!this._tabHeaders.find(tH => tH === t.header));

        this._tabHeaders
            // Filter out the loaded headers with attached tab instances.
            .filter(tH => !this.tabs.find(t => t.header === tH))
            .forEach(tH => {
                const content = this._tabContents.find(tC => tC.id === tH.id);

                if (!content) {
                    // Error if an associated tab content cannot be found for the given header.
                    throw new Error("A [suiTabHeader] must have a related [suiTabContent].");
                }

                // Create a new tab instance for this header & content combo.
                const tab = new Tab(tH, content);

                // Subscribe to any external changes in the tab header's active state. External changes are triggered by user input.
                tab.header.isActiveExternalChange.subscribe(() => this.onHeaderActiveChanged(tab));

                // Add the new instance to the list of tabs.
                this.tabs.push(tab);
            });

        // Assign each tab an index (which denotes the order they physically appear in).
        this._tabHeaders
            .forEach((tH, i) => {
                const tab = this.tabs.find(t => t.header === tH);
                if (tab) {
                    tab.index = i;
                }
            });

        // Sort the tabs by their index.
        this.tabs.sort((a, b) => a.index - b.index);


        if (!this.activeTab) { // Check if there are no current existing active tabs.
            // If so, we must activate the first available tab.
            this.activateFirstTab();
        } else if (!this.tabs.find(t => t === this.activeTab)) { // O'wise check if current active tab has been deleted.
            // If so, we must find the closest.
            // Use `setTimeout` as this causes a 'changed after checked' error o'wise.
            setTimeout(() => this.activateClosestTab(this.activeTab));
        }

        if (this.tabs.length === 0) {
            // Error if there aren't any tabs in the tabset.
            throw new Error("You cannot have no tabs!");
        }
    }
开发者ID:edcarroll,项目名称:ng2-semantic-ui,代码行数:53,代码来源:tabset.ts

示例6: ngAfterContentInit

  ngAfterContentInit() {
    // Register the simple columns to the table
    this.simpleColumns.forEach(simpleColumn => this.table.addColumnDef(simpleColumn.columnDef));

    // Register the normal column defs to the table
    this.columnDefs.forEach(columnDef => this.table.addColumnDef(columnDef));

    // Register any custom row definitions to the table
    this.rowDefs.forEach(rowDef => this.table.addRowDef(rowDef));

    // Register the header row definition.
    this.table.setHeaderRowDef(this.headerRowDef);
  }
开发者ID:OkBayat,项目名称:material2,代码行数:13,代码来源:wrapper-table.ts

示例7: ngAfterViewInit

 ngAfterViewInit(): void {
     this.olInstance = new ol.Map({
         layers: [],
         target: this._el.nativeElement,
         view: this._view.olInstance
     });
     this._tileLayers.forEach(item => {
         this.olInstance.addLayer(item.olInstance);
     });
     this._vectorLayers.forEach(item => {
         console.log('add vector layer');
         this.olInstance.addLayer(item.olInstance);
     });
 }
开发者ID:Zuzon,项目名称:ol3ng2,代码行数:14,代码来源:map.ts

示例8: selectTab

    selectTab(tab: TabComponent){
        // deactivate all tabs
        this.tabs.toArray().forEach(tab => tab.active = false);

        // activate current tab
        tab.active = true;
    }
开发者ID:jwerts,项目名称:angular2-esri-example,代码行数:7,代码来源:tabs.component.ts

示例9: init

 init() {
   this.items = this.contentItems.toArray();
   const length = this.contentItems.length;
   for (let i = 0; i < length; i++) {
     this.items[i].setParent(this);
   }
 }
开发者ID:tellxp,项目名称:avengers,代码行数:7,代码来源:menu-entry.component.ts

示例10: updateContentChildren

 private updateContentChildren(dark: Boolean) {
     if (this.contentChildren != null && dark != undefined) {
         this.contentChildren.forEach((child, index) => {
             child.setColor(index % 2 ? dark : !dark);
         });
     }
 }
开发者ID:hieutran106,项目名称:pro-angular-2ed,代码行数:7,代码来源:cellColorSwitcher.directive.ts


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