How to share data between AngularJS controllers?

Posted by Jessica Taylor | Updated on

In this example, we will learn how to share data between AngularJS controllers? A simple solution is to have your factory return an object and let your controllers work with a reference to the same object:

JS Code:

HTML Code:

Working Demo: http://jsfiddle.net/HEdJF/


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers