Mr Bell
Mr Bell

Reputation: 9338

Is there an a-frame event that fires after an entity is initialized?

I am looking for a way to detect when a new a-frames element has been added as a child of a given element(like "child-attached") but doesn't fire until the elements components have been initialized

alternatively, is there an event that is raised after an elements components have all been initialized?

Upvotes: 1

Views: 325

Answers (1)

ngokevin
ngokevin

Reputation: 13233

The loaded event will fire when all components initialized. This event doesn't bubble. I would have a component that you attach to the dynamically added entities, and listen to load event. Better yet, set dependencies to wait for the exact component you need.

Related, the componentinitialized event will fire for each initialized component.

Upvotes: 4

Related Questions