0

I want to use the fromState $scope in a function which is called in an unnamed function at the rootscope event.

It looks like that right now:

$rootscope.$on('$stateChangeStart'
   function(event, toState, toParams, fromState, fromParams){
        somethingService.saveSomething($scope)//the scope from fromState
   }
)

So i explain my whole model: somethingService is a service with all my DB functions for something. saveSomething is a method which saves something to the DB.

The fromState is the state I am currently working on something. When I change the state it should save the $scope.something by calling somethingService.saveSomething($scope.something) automatically with an event.

Here is the Documentation for the Statechange event which only exist at $rootscope level DOC

Opaldes
  • 193
  • 1
  • 10

0 Answers0