Chetan Sharma
Chetan Sharma

Reputation: 332

AngularJS Communication between different-2 Controller

I have 2 controllers ConfigurationController.js and CartController.js. I want to pass configuration data to cart.

I tried using below:-

$rootScope.value1 = '---';

$rootScope.value2 = '---';

$rootScope.value3 = '---';

and so on...............

But it will increase $rootScope size in browser memory and even forth and back we have to manage $rootScope value.

Is any other way in AngularJS that I can handle same situation in better way.

Upvotes: 0

Views: 37

Answers (1)

user5413346
user5413346

Reputation:

In angularJS this the way where you can pass value between the controller.js.

Othen than that you can use any StateServer technique, if data is growing in any size.

But both $scope or $rootscope will carry same memory, just way of communication is different.

Upvotes: 1

Related Questions