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
  • 120,221
  • 47
  • 236
  • 329
Partha Sarathi Ghosh
  • 9,918
  • 18
  • 57
  • 80

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,201
  • 18
  • 33