-1

I want to send data from one controller to another controller in angularjs without using

$scope.$broadcast
Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
nagulu vemula
  • 119
  • 1
  • 10

2 Answers2

0

Use scope if controllers are nested. Use required derictive controller

tamtakoe
  • 245
  • 3
  • 12
0

You should use a service or a factory but it is also possible to store data in $rootScope.

This is not advisable as root scope is a global variable and comes with its own set of problems here is an explanation why, but it might be just what you need if your testing something out.

In coding "if something's worth doing its worth doing right, right?" So I would advise building a factory in your Services.js file and then calling your factory in the controllers you want it accessible in.

Community
  • 1
  • 1
Joe Lloyd
  • 19,471
  • 7
  • 53
  • 81