0

I have a lightning component with a child component. I'm passing an array of object to the child. It seemed that there was an attribute that I could set to invoke a function once the child attribute was loaded. I thought is was named something on the line of "?afterloading?" or sort. I can't seem to find documentation anymore. I'm using a change handler to handle the situation but this is for a piece of mind.

I thought I could do something as follow:

<aura:component>
<aura:attribute name="foo" type="object[]" afterloading="{!c.dosomething}">
</aura:component>
3
  • "I can't seem to find documentation anymore" ? – glls May 29 '18 at 20:06
  • can't find in the documentation. I am most def need more coffee. I am confusing with afterscriptsloaded. – d.klauss May 29 '18 at 20:12
  • I think a changehandler is totally the right way to do it - it's not a workaround – Caspar Harmer May 29 '18 at 20:15
2

The only attributes for attributes are listed here. They are:

  • access
  • name
  • type
  • default
  • required
  • description

And no, you're not missing anything; you'd use an aura:valueChange listener, as you're doing, to listen for changes. You were most likely thinking about afterScriptsLoaded on the ltng:require component, which would be used to call some initialization script after loading external libraries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.