I'm new to angularjs and can use some guidance on the design of an app which uses a WebSocket connection to a backend. When the socket gets an onmessage event, it should load a dynamic view. Prior to loading the view, the model needs to be constructed based on some of the message parameters.
So, is it an acceptable angular solution to call a controller function from the onmessage event handler or is there a more angular way of doing things? If it is acceptable, how can I accomplish this? Should I call a route and pass in the route parameters to the controller? Thanks.