-
Notifications
You must be signed in to change notification settings - Fork 216
Cannot read property 'id' of null #487
Comments
Hey @Larisho I'll look into it. To facilitate my investigation, what version of Angular 2 are you using, and which router are you using? |
@ericjim Here's a pic of my package.json (in case you need more details) Thanks a mil! |
@ericjim I found the problem. It happens when I use Ex: |
@Larisho I've created a mini-app with an If possible could you create a plunker or sample app/code to reproduce? Or any other tips on reproducing? Thanks |
I'm experiencing this issue as well. The issue can be also reproduced at http://www.primefaces.org/primeng/#/dropdown I didn't manage to work around the issue using form tags. |
Option elements are excluded from being added to the compoment tree. However, we must also exclude them from being numbered when assigning augury-id's. Otherwise, if we have option elements with other elements after it, we will get undefined elements in the parent component's child array in the component tree, since it assigns to the child array using the augury-id as an index to the array. Example: If we have 4 <option> elements with a <div> after it, then the four <option> elements have augury-id 0 to 3 and the <div> would get id 4. When adding to the child array of the parent, the four <option> elements are not added. The <div> after is added, but is added to index 4 in the child array. This creates undefined elements in positions 0-3 in the array. The front-end is then given the componet tree and a JS error is thrown when the user highlights the null node.
Option elements are excluded from being added to the compoment tree. However, we must also exclude them from being numbered when assigning augury-id's. Otherwise, if we have option elements with other elements after it, we will get undefined elements in the parent component's child array in the component tree, since it assigns to the child array using the augury-id as an index to the array. Example: If we have 4 <option> elements with a <div> after it, then the four <option> elements have augury-id 0 to 3 and the <div> would get id 4. When adding to the child array of the parent, the four <option> elements are not added. The <div> after is added, but is added to index 4 in the child array. This creates undefined elements in positions 0-3 in the array. The front-end is then given the component tree and a JS error is thrown when the user highlights the null node.
Option elements are excluded from being added to the component tree. However, we must also exclude them from being numbered when assigning augury-id's. Otherwise, if we have option elements with other elements after it, we will get undefined elements in the parent component's child array in the component tree, since it assigns to the child array using the augury-id as an index to the array. Example: If we have 4 <option> elements with a <div> after it, then the four <option> elements have augury-id 0 to 3 and the <div> would get id 4. When adding to the child array of the parent, the four <option> elements are not added. The <div> after is added, but is added to index 4 in the child array. This creates undefined elements in positions 0-3 in the array. The front-end is then given the component tree and a JS error is thrown when the user highlights the null node.
For some reason, nothing is showing up in the component section of Augury.
It gave me these errors in the console:
And this is where the error was thrown:
My HTML is the same for 4 different components and the other 4 are evaluated correctly by Augury.
Am I doing something wrong?
Let me know if you need more info
EDIT I've discovered that this line of code in my HTML file is causing these errors in Augury
<input [(ngModel)]="details.name" id="name" type="text">
Any ideas?
Thanks,
The text was updated successfully, but these errors were encountered: