Я пытаюсь реализовать каскадные выпадающие в угловых, используя угловой материал.
Но я не могу принять соответствующие значения.
Может ли кто-нибудь помочь мне с этим?
<mat-form-field>
<mat-select [formControl]="country" placeholder="select"
#singleSelect>
<mat-option *ngFor="let country of countries.Countries"
[value]="domain">
{{country.CountryName}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select [formControl]="state"
placeholder="select" #singleSelect>
<mat-option *ngFor="let i=0;let state of countries.Countries"
[value]="domain">
{{state.CountryName[i].states.stateName}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select [formControl]="city"
placeholder="select" #singleSelect>
<mat-option *ngFor="let i=0;let j=0;let city of countries.Countries"
[value]="domain">
{{city.CountryName[i].states[j].CityName}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select [formControl]="municipality"
placeholder="select" #singleSelect>
<mat-option
*ngFor="let i=0;let j=0;k=0;let
municipality of countries.Countries"
[value]="domain">
{{municipality.city.CountryName[i].states[j].Cities[k].MunName}}
</mat-option>
</mat-select>
</mat-form-field>
[
{
"Countries":[
{
"id":0,
"CountryName":"Indonesia",
"States":[
{
"id":0,
"StateName":"Bali",
"Cities":[
{
"id":0,
"CityName":"Denpasar",
"Municipalities":[
{
"id":0,
"MunName":"Mun1"
},
{
"id":1,
"MunName":"Mun2"
},
{
"id":2,
"MunName":"Mun3"
}
]
},
{
"id":1,
"CityName":"Kuta",
"Municipalities":[
{
"id":0,
"MunName":"Mun4"
},
{
"id":1,
"MunName":"Mun5"
},
{
"id":2,
"MunName":"Mun6"
}
]
},
{
"id":2,
"CityName":"Tuban",
"Municipalities":[
{
"id":0,
"MunName":"Mun7"
},
{
"id":1,
"MunName":"Mun8"
},
{
"id":2,
"MunName":"Mun9"
}
]
}
]
},
{
"id":1,
"StateName":"Badgis",
"Cities":[
{
"id":0,
"CityName":"Denpasar",
"Municipalities":[
{
"id":0,
"MunName":"Mun1"
},
{
"id":1,
"MunName":"Mun2"
},
{
"id":2,
"MunName":"Mun3"
}
]
},
{
"id":1,
"CityName":"Andarab",
"Municipalities":[
{
"id":0,
"MunName":"Mun4"
},
{
"id":1,
"MunName":"Mun5"
},
{
"id":2,
"MunName":"Mun6"
}
]
}
]
}
]
},
{
"id":1,
"CountryName":"India",
"States":[
{
"id":0,
"StateName":"Delhi",
"Cities":[
{
"id":0,
"CityName":"Sonipat",
"Municipalities":[
{
"id":0,
"MunName":"Mun1"
},
{
"id":1,
"MunName":"Mun2"
},
{
"id":2,
"MunName":"Mun3"
}
]
},
{
"id":1,
"CityName":"Rohtak",
"Municipalities":[
{
"id":0,
"MunName":"Mun4"
},
{
"id":1,
"MunName":"Mun5"
},
{
"id":2,
"MunName":"Mun6"
}
]
}
]
},
{
"id":1,
"StateName":"Karnataka",
"Cities":[
{
"id":0,
"CityName":"Mangalore",
"Municipalities":[
{
"id":0,
"MunName":"Mun1"
},
{
"id":1,
"MunName":"Mun2"
},
{
"id":2,
"MunName":"Mun3"
}
]
},
{
"id":1,
"CityName":"Hubli",
"Municipalities":[
{
"id":0,
"MunName":"Mun4"
},
{
"id":1,
"MunName":"Mun5"
},
{
"id":2,
"MunName":"Mun6"
}
]
}
]
}
]
}
]
}
]