aframevr / aframevr/aframe

a-asset-item lastindexof null

Open
#4,185 4 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.