Dynamic start-up page does not get stateParams


#1

I am building an app that has content for each month of the year. I would like to show the content of the current month when the user starts the app. Afterwards, the user can still choose content of other months (via a side menu).

I managed to do this in $ionicPlatform.ready as follows:

.run(function($ionicPlatform, $filter, $location, $rootScope, $state) {
$ionicPlatform.ready(function() {
    //
    // removed other code here for clarity
    //
    date = new Date();
    month = $filter('date')(date, 'M');
    newPath = '/maand/' + month + '/groenten';
    $location.path(newPath);
    $rootScope.$apply();
});
})

This takes me to the correct view, but this does not get the parameter of month from the URL which is necessary to show the dynamic title in the header. Can anyone help me on this, please? Thanks!