1

I've got component with some attributes. For example:

<aura:attribute name="missedCalls" type="List" access="global" />

<aura:attribute name="tryingToInitiateCall" type="Boolean" access="global" />

I do not know how many of them are in the component nor their names. I am trying to implement universal static resource logger.

So my question is: is it possible to iterate through all of them in the controller (get their names, values) and don't change anything in that component (adding class, id etc.).

I have tried

var attributes = $("aura:attribute");

, but it is not working.

Thanks.

  • Consider that the .cmp is transformed into HTML by the framework so aura:attribute will not be present in the HTML. – Keith C Aug 7 '17 at 13:40
  • And I don't see anything in the documented API that would help so you might have to rely on a fragile reverse engineered solution to do this directly in the JavaScript if this is really important to you. Or you could write some build-time tools that parse the .cmp files and generated JSON you could reference. – Keith C Aug 7 '17 at 13:50

Your Answer

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

Browse other questions tagged or ask your own question.