Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Events and Actions in Model Injection

Adrián Rivero edited this page Mar 16, 2017 · 4 revisions

When injecting a model, there's 4 annotations available that can be used to modulate the injection process.

An important feature of these annotations, is that if the specified Event doesn't exists, it will be automatically generated by the annotations.

@LoadOnEvent

This annotation takes as parameter an event class. It will inject the field only when the event is received, avoiding injecting the class when the class is loading (similar than a Lazy load, but this one is triggered with an event).

@UpdateOnEvent

This annotation takes as parameter an event class. It will inject the field when an event is received.

@PutOnEvent

This annotation takes as parameter an event class. It will put the field when an event is received.

@PutOnAction

This annotation takes as parameter an Id. It will put the field when the view with the provided Id be clicked.

See also