I'm Working on search form were i need to check whether city is empty or not. If it is empty then assign Bangalore to it other show the selected city. Here is my If condition
if(this.locations[0].city!="")
{
var Dynamic = this.locations[0].city;
}
else
{
Dynamic = "Bangalore";
}
But getting
Runtime Error. cannot read property '0' of undefined.
I am new to Ionic 2.