我正在尝试使用函数Array访问主组件类中的多个组件的字段。
import { Component } from '@angular/core';
@Component({
selector: 'new-app',
template: `<h1>{{title}}</h1>`
})
export class AppComponent {
public _moduleName: string = null;
constructor() {
this._moduleName = 'App-Component';
}
title = 'App';
}
组件类
import { Component } from '@angular/core';
@Component({
selector: 'new-app1',
template: `<h1>{{title}}</h1>`
})
export class SrcComponent {
public _moduleName: string = null;
constructor() {
this._moduleName = 'Src-Component';
}
title = 'Source';
}
第二个组件
<f:image
src="{image.0.uid}"
treatIdAsReference="1"
width="1140"
height="375"
cropVariant="desktop"
/>