Salesforce QA/Lightning

What are the basic differences between Application Event and Component Event?

어디다쏨 2020. 1. 19. 14:52
728x90

Q : What are the basic differences between Application Event and Component Event?
Q : 응용 프로그램 이벤트와 구성 요소 이벤트의 기본 차이점은 무엇입니까?

A : Component events are used to do communication between child and parent. They use bubbling and capture same as used in DOM events. A change in a child component can be communicated to the parent component via component event.
Application events are used to communicate any change in the component to a broader audience. Any component who has registered for this event will get a notified.
A : 구성 요소 이벤트는 자식과 부모 간의 통신을 수행하는 데 사용됩니다. 버블 링을 사용하고 DOM 이벤트에서 사용된 것과 동일하게 캡처합니다. 하위 구성 요소의 변경 사항은 구성 요소 이벤트를 통해 상위 구성 요소와 통신할 수 있습니다.
응용 프로그램 이벤트는 구성 요소의 변경 사항을 더 많은 사람들에게 알리는 데 사용됩니다. 이 이벤트에 등록한 모든 구성 요소는 알림을 받습니다.

728x90