I have a question, I've included the code snippet below in my controller:
vf.filtroses = [];
FiltrosService.currentuser().success(function(data, status) {
vf.filtroses = data;
});
I'm trying to check if vf.filtroses is empty or has elements. I attempted using .length and equals:
vf.nofiltros = false;
vf.filtroses = [];
FiltrosService.currentuser().success(function(data, status) {
vf.filtroses = data;
});
if(angular.equals([], vf.filtroses)){
vf.nofiltros = true;
}
Unfortunately, the above approach did not work for me!
Any suggestions please?