I would like to pass a parameter to a JavaScript controller method so the method could format the data...
Component
<ul>
<aura:iteration items="{!v.listOfStuff}" var="a">
<li>{! c.formatFromUntil(a.Start__c, a.End__c) }</li>
</aura:iteration>
<ul/>
JavaScript Controller
formatFromUntil : function(starts, ends){
// format the two date like below
return 'from 3:00 PM until 4:30 PM'
},
But the developer console will not save, and I get this error:
Failed to save exampleComponent.cmp: unexpected token: '(' at column X of experssion: c.formatFromUntil(a.Start__c, a.End__c) : Source
It obviously does not want me accessing controller methods like this.
How should I be approaching this?