Component Events
A component event is fired from an instance of a component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that receives the event. The component that fires an event is known as the source component.
The component that fires an event can set the event’s data. To set the attribute values, call event.setParam() or event.setParams().
Fire a component Event
In terms of firing an event you need to register that component event in your component and then you can fire the same. it looks something like below
A component can handle its own event by using the <aura:handler> tag in its markup. The name attributes in <aura:registerEvent> and <aura:handler> must match, since each event is defined by its name.
Application Events
Application event in simple words can be used in multiple components and component that has the handler for the event will be notified.
To create a custom application event, you need to use the <aura:event> tag in the event resource. You need to define type="Application" tag. To use you need to register application event same way as component event
To fire the application event you need to use event.setParam();
Events are of the most widely used in lightning component. so when you should use which one is also important.
thanks
A component event is fired from an instance of a component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that receives the event. The component that fires an event is known as the source component.
The component that fires an event can set the event’s data. To set the attribute values, call event.setParam() or event.setParams().
Fire a component Event
In terms of firing an event you need to register that component event in your component and then you can fire the same. it looks something like below
A component can handle its own event by using the <aura:handler> tag in its markup. The name attributes in <aura:registerEvent> and <aura:handler> must match, since each event is defined by its name.
Application Events
Application event in simple words can be used in multiple components and component that has the handler for the event will be notified.
To create a custom application event, you need to use the <aura:event> tag in the event resource. You need to define type="Application" tag. To use you need to register application event same way as component event
To fire the application event you need to use event.setParam();
Events are of the most widely used in lightning component. so when you should use which one is also important.
thanks
ReplyDeleteتعد الاول افضل شركة غسيل خزانات بالمدينة المنورة تعمل على استخدام افضل ادوات تنظيف وتعقيم خزانات المياه
معلم بلاط بجدة
ReplyDeleteتركيب عشب صناعي بجدة
تركيب دش بجدة
تركيب كاميرات مراقبة بجدة
تركيب مطابخ بالدمام
شراء ثلاجات مستعملة بالرياض
شراء مكيفات مستعملة بالرياض
شراء اثاث مستعمل بجدة
Great Article
ReplyDeleteCloud Computing Projects
Networking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training