AngularJS Share data between controllers

AngularJS Share data between controllers

In this Post We Will Explain About is AngularJS Share data between controllers With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to angularjs share data between controllers rootscope Example

In this post we will show you Best way to implement share data between controllers angularjs using broadcast, hear for pass value from one controller to another in angularjs with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Also Read This πŸ‘‰   How to Get the php_host in PHP?

How to share data between controllers in AngularJS

In this Example,First of all Add or Include External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priority set.After that Include your relevant CSS Class.

There are the following list of the two types of Share data between controllers in AngularJS.

1.Global Variable

Include External Libs





var app = angular.module('liveapp', []);
app.controller('liveAppCtrlOne', function ($rootScope,$scope, LiveServices) {
   $ = "Vinodh";
   $scope.fetchData = function(){

app.controller('liveAppCtrlTwo', function ($scope, LiveServices) {									
	$scope.getsec = LiveServices.getComments();

app.service('LiveServices', function () {
	var comments = "";
	var liveSerObject = {};
	liveSerObject.getMsg = function (mesg){
	   this.comments= mesg;
	liveSerObject.getComments = function (){
					return this.comments;
	return liveSerObject;

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Free Live Chat for Any Issue


I hope you have Got What is different ways to share data between controllers angularjs And how it works.I would Like to have FeedBack From My Blog( readers.Your Valuable FeedBack,Any Question,or any Comments about This Article( Are Most Always Welcome.

Rate this post

Also Read This πŸ‘‰   Very Simple PHP Script to Upload Image or file from an URL