I want to be able to get all the keys from an object. Assuming the object looks like below:
this.reservation = {
"Firstname" : "" ,
"Lastname" :"" ,
"Phone" : "",
"Email" : "",
"Date" : "yyyy-mm-dd hh:mm",
"Starthour" : "",
"Endhour" : "",
"Persons" : ""
}
If I want to be able to check whether all the keys' values are "", except Date of course, how would I go about doing that?
I've tried to do a forEach to get the keys:
angular.forEach(this.reservation,
function(value, key) {
console.log(key);
});
But it doesn't work. Any hints?