0.9.21 sideMenuController missing?!


#1

Hi there! I just upgraded from 0.9.17 to 0.9.21 and now the sideMenuController seems to be undefined. Are there any changes in calling the toggleLef() method? Or am I missing something? My Code:

<div ng-controller="MenuCtrl">
    <nav-view></nav-view>
</div>

.controller('MenuCtrl', function ($rootScope, $scope) {

    $scope.toggleLeft = function () {
        $scope.sideMenuController.toggleLeft();
    };

})

The error:
Cannot call method ‘toggleLeft’ of undefined

Thank you for your help!


#2

try using the $rootScope , what i do is log the rootScope and see the components and the functions i can call inside different parts of my app, because i’m still confused about scopes


#3

@phii, nothing changed AFAIK. Can we see more markup? It could be a scoping issue based on placement in the markup tree.


#4

Sorry for answering so late!
But i just found the problem! While upgrading, I was also changing from the route provider to the state provider and therefore I also put the sidemenu in the “nav-view”. So in the “nav-view” the “sidemenus” was injected. Wrapping the ng-controller=“MenuCtrl” around the “sidemenus”, not the “nav-view” like posted above, solved the problem. But thank you very much anyway!