I have a function in controller 1 that return an array of object,
And in Controller 2, I have to loop in the list that I created so i thought that this will work.
$rootScope.$emit("CallParentMethod").forEach(function(row)
{
console.log(row.key);
});
but the object that i'm getting doesn't have the same format that i was expecting , with console.log I saw that object that i'm getting in Controller2 is like
{name: "CallParentMethod", targetScope: l, defaultPrevented: false, currentScope: null}
So how can I loop into an object that I got from another controller.