a-asset-item lastindexof null
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
When using property -binding for Angular
Cannot read property 'lastIndexOf' of null
- A-Frame Version: 0.9.2
- Platform / Device: Angular for Chrome
- Reproducible Code Snippet or URL:
<a-asset-item
*ngFor="let model of assetItems; trackBy: trackAsset"
[attr.id]="model?.id"
[attr.src]="model?.asset?.file?.uri">
</a-asset-item>
Angular creates the tag first, then binds the properties. a-asset-item should not error out if no src is provided.
The following modification works in latest Chrome, Firefox, and iOS-Safari:
registerElement('a-asset-item' ...
...
var src = this.getAttribute('src') || '';
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to the a-asset-item registerElement implementation; start there and reproduce the Angular property-binding example with a missing src. Done means a missing src no longer causes the reported lastIndexOf null error in Chrome, Firefox, and iOS Safari.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100