TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
AKhil kotha
NA
3
1.4k
Appending Dynamic variable value to ng model of mat select is not work
Jan 13 2021 1:43 PM
<mat-select placeholder="Select Crop Type" [(ngModel)]="cropname" class="select" formControlName="croptype">
<mat-option *ngFor = "let i of Croptype" [value] = "i">{i.CropName}</mat-option> </mat-select>
In component.ts
Croptype = [ { CropID: '1', CropName: 'sweetlime', ScientificName: 'CitrusImetta' }, ];
this.cropname="sweetlime" when iam updating ng model value with below line the above issue occurs
The Example for the issue :https://stackblitz.com/edit/angular-be1gqv?file=src%2Fapp%2Fapp.component.html
In the above issue if [value]=i.Crop Name and Crop name value inside array and ng model value are same, then it is showing on dropdown ,but if [value]="i", it is not working. But based on our requirement we need to have complete object value in [Value].so please suggest how to resolve this issue
Reply
Answers (
1
)
Simplifying Known Vanilla JS to Advanced ES
how to add image to file type in typescript