i have a interface in angular4
interface StatusDetail {
statusName: string,
name: string
}
and i have assigned some values to it like
//angular Component
export class EditComponent implements OnInit{
statusDetail: StatusDetail;
ngOnInit() {
this.statusDetail.statusName = 'text Status';
this.statusDetail.name= 'text Name';
}
}
i'm trying to reset to default null like this
SetNull() {
this.statusDetail = null
}
but it gives error
Type null is not assignable to type StatusDetail
how can i do this?