export class CategoryComponent{
public categories : any = [
{ name: 'Hotel', type: 'Company'},
{ name: 'School', type: 'Company'}
];
}
category.html
<form name="addCategoryForm" class="addCategoryForm" #addCategoryForm="ngForm" novalidate>
<div class="form-group">
<label class="control-label">Category Type</label>
<select class="form-control" name="SelectCategory" [(ngModel)]="selectcategory" #SelectCategory="ngModel" required>
<option>Category Type</option>
<option *ngFor="let category of categories">{{category.name}} </option>
</select>
<button [disabled]="!addCategoryForm.form.valid">Save</button>
</div>
</form>
如何在选择表单中设置占位符以及表单验证