Hi Павел,

Your controller 'due' wil get initialized before the $routeParams are 
set/changed. If you wont something like this to work, you need to act upon 
one of the route-change events, and update your controller vars that way. 
Something like this: 
(ES6 fat arrow functions use their parents 'this'!)

    function due($scope,$routeParams) {
        $scope.$on('$routeChangeSuccess', (ev,cur,prev) => {
            this.ev = ev;
            this.cur = cur;
            this.prev = prev;
            this.params = $routeParams;
        })
    }

This is using the 'controller as' syntax.

Hope this helps you a bit,
Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to