Reputation: 332
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
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