I had add popup field, when the popup opens i want to get one field to be preselected with its option, i am getting the required value in console but its not reflecting on html. Can anyone help me to solve this issue.
HTML:
<div class="form-group">
<label class="showlabel">Role</label>
{{selectedRole}}
<ng-select [options]="roles" [(ngModel)]="user.user.role_id" name="AddRole" class='filterDropDown cat' placeholder="Role" notFoundMsg="No Role Found" required>
</ng-select>
</div>
TS: To open popup
addCompany (){
this.user = new Users();
this.addCompanies.show();
let userData = this.roles.filter(role => role.label === 'appUser');
if(userData && userData[0]) {
this.selectedRole = userData[0].label.toString();
}
console.log(this.selectedRole);
}