I have a dropdown that I want to populate using the following code:
this.categoryService.GetListItem(this.GetAllcatListUrl).subscribe(data=>{
this.listCatModel=data,
this.listCatModel.push({
id:0,
name:'Main Category',
parentId:0
})
});
However, when I try to use the push
method on this.listCatModel
, I encounter the following error:
ERROR TypeError: _this.listCatModel.push is not a function
What could be causing this issue? How can I go about resolving it?