controllerHow does data (communication) pass between them?
Now there is a requirement: the page has a search box and buttons, the search box and buttons belong to one
controller. Below the search box and buttons is a list, which is a
Enter the content in the search box, click the button, and use
$httpAfter the service gets the data from the background, how does it transfer the data to the list
controllerThen update the list view?
If I use a big one
controllerWrapper search box, button, list, then list or one
controller, that is to say
controllerIn this case, how do you put the outer layer
$httpThe data obtained by the service is transferred to the inner layer.
Please answer two questions separately, because both situations will be used in the project, thank you!
If the second situation is very easy, isn’t the controller of the list inherited from the big controller? Just take it directly.
If it is a separate controller, it is a bit troublesome. You can consider sending it through an event: to the parent scope shared by both parties; Or send with a global event.