How do controller of AngularJS communicate with each other?

  node.js, question

Excuse meAngularJSThecontrollerHow 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 onecontroller. Below the search box and buttons is a list, which is acontroller. .

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 listcontrollerThen update the list view?

If I use a big onecontrollerWrapper search box, button, list, then list or onecontroller, that is to saycontrollerIn this case, how do you put the outer layercontrollervia$httpThe data obtained by the service is transferred to the inner layer.controller?

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.

Referenceshttps://github.com/xufei/blog/issues/18