How to access apex class property in lightning component

Lightning Component

Prerequisites : basic understanding of Lightning Component and Apex programming


  • First we create  component controller class .
  • It’s have 3 {get ;set;}  property variable on line number 5,6 and 7, with @AuraEnabled annotation .
  • The @AuraEnabled annotation enables client- and server-side access to an apex controller method and controller property. Providing this annotation makes your methods and properties available to your Lightning components.
  • In this controller we have a single method which return type is class type .



    • In our test component we have a aura:attribute which type is class Type.
    • On the component initialize  call initClass() method and set return value in aura:attribute.
    • And finally access class property in component by {! v.objClassController.PropertyName }



apex class properties
Like our facebook page for new post updates.?

(Visited 6,443 times, 12 visits today)


Leave a Reply