is there a way to trigger a message from within a Controller’s params
function?
@roberto you could, but it would go to the wrong "instance" of the controller. Params function is called before the controller is started. Why not calling it from the start
function?
I probably don’t understand the lifecycle of a component.
the start function only gets called once, right?
while the params function gets called everytime the url changes?
I have a component that is already rendered, and want to modify it everytime the url changes.
oh
you get the route-changed command sent through the in-chan everytime route changes
@roberto ^
ah
thank you
that is very helpful
I didn’t think to look inside that file. Didn’t understand its purpose
it basically clears the stale data from the entity db on each route change
so you can have a controller that is not associated with any component
yeah
controllers operate on the route
they don't really care about components
okay, I think it is kind of clicking. So, the only way a component can be linked to a controller is via its topic
. And it can only be associated to one topic, hence only to one controller.
yeah
but that doesn’t restrict it from sending commands to other controllers using the send-command
, right?
it does because the component's send command will always send it on it's one topic
but if you need to broadcast the message
theoretically you could add a transducer
on teh command channel
and duplicate commands
ah, so change the url if you want to broadcast?
to various topics
yeah
okay, that sounds cleaner
also, controllers can send commands to other controllers
so you could have a controller that relays commands from the component to other controllers
cool, yeah I did that with a search component
but I don’t think I understood what I was doing :simple_smile:
it is becoming clearer now.