• Utilization Matrix 2
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi ,

 How to get the length of a attribute of type " Map" from lightning controller.

Component:
<aura:attribute name="IndexMap" type="Map" default="{ 'Draft':1, 'Pending':2, 'NeedInfo':3, 'Resolved':4, 'Closed':5}"/>

Controller:
var myMap= component.get("v.IndexMap");
        alert(myMap.length);

The above code result to "undefined". Actually I have to get "5" as myMap has 5 elements.  Can you please help in getting this.

Thanks in advance.

Regards,
Naveen.