You could use ‘hasOwnProperty‘ to check if object have the specific
property.
if($scope.test.hasOwnProperty('bye')){
// do this
}else{
// do this then
}
Here’s a demo in jsFiddle.
Hope this helpful.
You could use ‘hasOwnProperty‘ to check if object have the specific
property.
if($scope.test.hasOwnProperty('bye')){
// do this
}else{
// do this then
}
Here’s a demo in jsFiddle.
Hope this helpful.