HTMLCollection access seems to be broken in angular environment for some
reason, resulting in my being unable to traverse a nested set of elements.
With the the following code:
var elements = tElement[0].getElementsByTagName('mw-template');
console.log(elements);
console.log(elements instanceof HTMLCollection);
console.log(elements.item(0));
console.log(elements[0]);
I get the following results:
[item: function, namedItem: function]
0: mw-template.ng-scope
1: mw-template.ng-scope
2: mw-template.ng-scope
3: mw-template.ng-scope
4: mw-template.ng-scopelength:
5__proto__: HTMLCollection
directives.js:137 true
directives.js:138 null
directives.js:139 undefined
In other words it appears to be a valid HTMLCollection, but I am unable to
access it. I've searched through google, and found a couple of similar
complaints, but no answers.
I've tried countless other approaches around trying to cast the items as an
array (though I actually want the live versions), and using both jqLite and
jQuery to cast the items at various steps into jQuery collections. Also
taking direct Nothing seems to work.
Note that the collection id deeply nested:
this code:
console.log(tElement[0].children[0].children);
console.log(tElement[0].children[0].children[0]);
gives this result
[item: function, namedItem: function]
0: mw-block-toolbar.ng-scope
1: mw-template.ng-scope
2: mw-template.ng-scope
3: mw-template.ng-scope
4: mw-template.ng-scope
5: mw-template.ng-scopelength:
6__proto__: HTMLCollection
undefined
Anyone have any ideas?
This is a showstopper.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.