无法读取null的属性(读取'控件')嵌套形式的形式
我是新来的角。努力根据Angular创建嵌套形式,我面临着基于下面显示的JSON结构来控制某些字段的困难,我面临的困难在获得Control Assetslist ->描述部分
data = {
headline: [
{
language: 'en',
headlineText: 'example headline',
},
],
bodyText: [
{
language: 'en',
bodyText: 'example bodytext',
},
],
location: {
name: 'mkontheway',
openingHours: [
{
day: 'Mon-frd',
timing: '10.00PM-9AM',
},
],
address: {
postCode: 'test',
country: 'test',
},
},
assetsList: [
{
description: [
{
language: 'En',
text: 'Sports News Updated',
},
],
assetType: 'Description',
assetLink: 'NewsLink',
filePath: 'Not yet fill',
},
],
};
创建了一个相同的stackblitz
我 create-news/create-news.component.ts“ rel =“ nofollow noreferrer”> stackblitz链接
I'm new to angular. Working on creating nested form in angular where I'm facing difficulties for getting controls of some fields based on the JSON structure shown below where I'm facing difficulties in getting control assetsList -> description section
data = {
headline: [
{
language: 'en',
headlineText: 'example headline',
},
],
bodyText: [
{
language: 'en',
bodyText: 'example bodytext',
},
],
location: {
name: 'mkontheway',
openingHours: [
{
day: 'Mon-frd',
timing: '10.00PM-9AM',
},
],
address: {
postCode: 'test',
country: 'test',
},
},
assetsList: [
{
description: [
{
language: 'En',
text: 'Sports News Updated',
},
],
assetType: 'Description',
assetLink: 'NewsLink',
filePath: 'Not yet fill',
},
],
};
I created a Stackblitz for the same please help me for solving this error
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
索引的功能
AssetSlistDescriptionFormData可以不是成为一个getter,因为您需要表示AssetSlist的“索引” - 您在另一个formarray内部有一个formarray-否则您通过索引并使用
assetsListDescriptionFormData can not be a getter because you need indicate the "index" of the assetsList -you has a FormArray inside another FormArray- else a function that you pass an index
And use