10000 GitHub - rclayton/NG-Communicate-Ctrls: Demonstrations on how to communicate between controllers in Angular.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rclayton/NG-Communicate-Ctrls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NG-Communicate-Ctrls

A lot of friends learning Angular ask me about this topic (communicating between controllers). So much, in fact, that I'm writing a blog post about it.

The real answer is that there are a number of ways, but, the best practice is to keep controllers from being aware of each other as much as possible (personally, I would insist they should never be aware of each other).

The following directories include examples of each strategy. This codebase will be updated as I write the articles:

  • parent-child: demonstrates Parent-Child controller communication using shared scope.
  • pubsub: demonstrates using Angular's emit, broadcast, and on facility to communicate between components.
  • service: demonstrates using a third-party mechanism to synchronize state between controllers.
  • router: demonstrates how to pass state via route transitions in an application.

About

Demonstrations on how to communicate between controllers in Angular.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0