I am a bit confused. I have the following code in the directive:
NavTabsDirective.prototype.addPane = function (pane) {
if (!_.isObject(pane) || "Pane" !== pane.constructor.name) {
throw new TypeError("pane must be an instance of Pane");
}
if (_.isUndefined(this.FirstPane)) {
this.FirstPane = pane;
}
this.Panes[pane.name] = pane;
};
when I look in the debugger at the this.Panes array, I see something like:
this.Panes[name1] = paneObject -- with properties
this.Panes[name2] = paneObject -- with its properties
I want to understand how to search this array. Say, this is my code:
let invalid = (_.findIndex(this.Panes, { 'isValid': false })>=0);
which I commented out as it could not find a pane where isValid is false although I can see such pane in that array.
So, my confusion comes from the fact that the Panes array object has names to access each pane object and so I don't know how to properly search it. How would I check for invalid among the panes?