in select option how to make one default in angular
<option [ngValue]="undefined" selected>Select</option>
in select option how to make one default in angular
<option [ngValue]="undefined" selected>Select</option>
preselect a value in angular dropdown
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'my-app';
prtl = {
"name": "Stock Market",
"id": 10,
"category": {
"id": "2",
"name": "Football"
}
};
categories = [
{
"id": "1",
"name": "Cricket"
},
{
"id": "2",
"name": "Football"
}
];
categoryToSelect = this.prtl.category;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us