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


TypeScript QueryList.map方法代码示例

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


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

示例1: ngAfterContentInit

	ngAfterContentInit() {
		if (this._columns && this._columns.length) {
			if (this._config) {
				this._config["columns"] = this._columns.map((c) => c._settings);
			} else {
				this._opts["columns"] = this._columns.map((c) => c._settings);
			}
		}
		if (this.featuresList){
			if (this._config) {
				this._config["features"] = this.featuresList.allFeatures.map((c) => { return c.initSettings;} );	
			} else{
				this._opts["features"] = this.featuresList.allFeatures.map((c) => { return c.initSettings;});
			}
		}
		super.ngOnInit();
	}
开发者ID:MayaKirova,项目名称:igniteui-angular2,代码行数:17,代码来源:iggridbase.ts

示例2: nextSlide

 nextSlide() {
   this.slideComponents.map((item, index) => {
     item.isActive = false;
     let next = this.currenIndex + 1 >= this.slideComponents.length ? 0 : this.currenIndex + 1;
     if (index == next) {
       item.isActive = true;
     }
   });
   this.currenIndex >= this.slideComponents.length - 1 ? this.currenIndex = 0 : this.currenIndex++;
 }
开发者ID:websiddu,项目名称:notar,代码行数:10,代码来源:carousel.component.ts

示例3: prevSlide

  prevSlide() {

    this.slideComponents.map((item, index) => {
      item.isActive = false;
      let prev = this.currenIndex - 1 < 0 ? this.slideComponents.length - 1 : this.currenIndex - 1;
      if (index == prev) {
        item.isActive = true;
      }
    });

    this.currenIndex <= 0 ? this.currenIndex = this.slideComponents.length - 1 : this.currenIndex--;

  }
开发者ID:websiddu,项目名称:notar,代码行数:13,代码来源:carousel.component.ts

示例4: onAvailableOptionsRendered

    protected onAvailableOptionsRendered():void {
        // Unsubscribe from all previous subscriptions to avoid memory leaks on large selects.
        this._renderedSubscriptions.forEach(rs => rs.unsubscribe());
        this._renderedSubscriptions = [];

        this._renderedOptions.forEach(ro => {
            // Slightly delay initialisation to avoid change after checked errors. TODO - look into avoiding this!
            setTimeout(() => this.initialiseRenderedOption(ro));

            this._renderedSubscriptions.push(ro.onSelected.subscribe(() => this.selectOption(ro.value)));
        });

        // If no options have been provided, autogenerate them from the rendered ones.
        if (this.searchService.options.length === 0 && !this.searchService.optionsLookup) {
            this.options = this._renderedOptions.map(ro => ro.value);
        }
    }
开发者ID:edcarroll,项目名称:ng2-semantic-ui,代码行数:17,代码来源:select-base.ts

示例5: ngAfterViewInit

    public ngAfterViewInit() {
        const onmouseup = fromEvent(document, "mouseup")
        const onmousemove = fromEvent(document, "mousemove")
        this.grab.map(element => {
            const horizontal =
                element.nativeElement.classList.contains("z-grab-left") ||
                element.nativeElement.classList.contains("z-grab-right")
            const direction =
                element.nativeElement.classList.contains("z-grab-left") ||
                element.nativeElement.classList.contains("z-grab-top")
                    ? -1
                    : 1
            const onmousedown = fromEvent(element.nativeElement, "mousedown")
            const propertyName = element.nativeElement.dataset.name
            return onmousedown
                .pipe(
                    switchMap((start: MouseEvent) => {
                        const startValue = this.boxModel.value[propertyName]

                        return onmousemove.pipe(
                            map((current: MouseEvent) => {
                                return {
                                    horizontal,
                                    propertyName,
                                    value:
                                        startValue +
                                        direction *
                                            (horizontal
                                                ? current.screenX - start.screenX
                                                : current.screenY - start.screenY),
                                }
                            }),
                            takeUntil(onmouseup),
                        )
                    }),
                )
                .subscribe(props => {
                    this.boxModel.patchValue({
                        [props.propertyName]: props.value,
                    })
                })
        })
    }
开发者ID:zodiac-team,项目名称:zodiac-ui,代码行数:43,代码来源:layout-pane.component.ts

示例6: getParam

 private getParam() {
   let value;
   this.header.map(p => value = p.param);
   return value;
 }
开发者ID:xianggq520,项目名称:angular4_demo,代码行数:5,代码来源:child.component.ts

示例7: ngAfterContentChecked

 ngAfterContentChecked(): void {
   console.log("child投射变更检测完毕,参数是"+this.getParam());
   this.header.map(p => p.param = "1");
 }
开发者ID:xianggq520,项目名称:angular4_demo,代码行数:4,代码来源:child.component.ts


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