本文整理汇总了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();
}
示例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++;
}
示例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--;
}
示例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);
}
}
示例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,
})
})
})
}
示例6: getParam
private getParam() {
let value;
this.header.map(p => value = p.param);
return value;
}
示例7: ngAfterContentChecked
ngAfterContentChecked(): void {
console.log("child投射变更检测完毕,参数是"+this.getParam());
this.header.map(p => p.param = "1");
}