AuraEnabled Annotation

The AuraEnabled annotation provides support for Apex methods and properties to be used with the Lightning Component framework.
The AuraEnabled annotation is overloaded, and is used for two separate and distinct purposes.
  • Use @AuraEnabled on Apex class static methods to make them accessible as remote controller actions in your Lightning components.
  • Use @AuraEnabled on Apex instance methods and properties to make them serializable when an instance of the class is returned as data from a server-side action.
Important

Important

  • Don’t mix-and-match these different uses of @AuraEnabled in the same Apex class.
  • Only static @AuraEnabled Apex methods can be called from client-side code. Visualforce-style instance properties and getter/setter methods aren’t available. Use client-side component attributes instead.