본문 바로가기
Salesforce

[Salesforce] Aura Enabled Annotation

by clove17 2021. 12. 23.
728x90
반응형

AuraEnabled Annotation

The @AuraEnabled annotation enables client- and server-side access to an Apex controller method. Providing this annotation makes your methods available to your Lightning components (both Lightning web components and Aura components). Only methods with this annotation are exposed.

In API version 44.0 and later, you can improve runtime performance by caching method results on the client by using the annotation @AuraEnabled(cacheable=true). You can cache method results only for methods that retrieve data but do not modify it. Using this annotation eliminates the need to call setStorable() in JavaScript code on every action that calls the Apex method.

For more information, see Lightning Aura Components Developer Guide and Lightning Web Components Developer Guide.

AuraEnabled 주석 기능 (@AuraEnabled)
@AuraEnabled 주석을 사용하면 Apex 컨트롤러 메서드에 대한 클라이언트 및 서버 측 액세스가 가능
Ligntning 구성 요소에서 메서드를 사용 할 수 있음
메서드에서만 사용가능
 

@AuraEnbaled(cacheable=true)

API 버전 44.0 이상에서는 주석을 사용하여 클라이언트에서 메서드 결과를 캐싱하여 런타임 성능을 향상

데이터를 검색하지만 수정하지 않는 메서드에 대해서만 메서드 결과를 캐시할 수 있음

setStorable() Apex 메서드를 호출하는 모든 작업의 JavaScript 코드에서 이 주석을 사용하면 호출할 필요가 없음

 

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_AuraEnabled.htm

 

AuraEnabled Annotation | Apex Developer Guide | Salesforce Developers

The @AuraEnabled annotation enables client- and server-side access to an Apex controller method. Providing this annotation makes your methods available to your Lightning components (both Lightning web components and Aura components). Only methods with this

developer.salesforce.com

 

728x90
반응형