1

I have the following $routerProvider

$routeProvider.
          when('/list', {
            templateUrl: '/list.jsp',
            controller: 'ListController'
          }).
          when('/edit', {
            templateUrl: '/edit.jsp',
            controller: 'EditController'
          }).
          otherwise({ redirectTo: '/list' }
);

I have a ui-grid, I want to pass the selected row data from ListController to EditController. Since my selected row is a JSON object with lots of properties, I do not want to send those data through URL.

More over this ListController and EditController is being used for different data structure like {a:10, b:20} as a row. Some time {x:11, y:12, z:21} as a row some times.

Radim Köhler
  • 122,561
  • 47
  • 239
  • 335
Partha Sarathi Ghosh
  • 10,936
  • 20
  • 59
  • 84

1 Answers1

1

Please use use a service in this case for passing data between controllers.

Ref: AngularJS Service Passing Data Between Controllers

Community
  • 1
  • 1
M22an
  • 1,242
  • 1
  • 18
  • 35