Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Ui-sref not firing on first click when using multiple resolves

$
0
0

Hello everyone, I have the following state:

 .state('app.category', {
            url: '/categories/:categoryId',
            views: {
                'menuContent': {
                    templateUrl: 'templates/category.html',
                    controller: 'CategoryCtrl'
                }
            },
            resolve: {
                category: function ($stateParams, TestCategoriesService) {
                    return TestCategoriesService.getCategory($stateParams.categoryId);
                },
                tests: function (category, TestService) {
                    return TestService.getTestsByCategory(category.id);
                }
            }
        })

controller:

.controller('CategoryCtrl', function ($scope, category, tests) {
    $scope.category = category;
    $scope.tests = tests;
})

and access it via ui-sref:

 <a ui-sref="app.category({categoryId: categories[i].$id })">

Everything is working, despite the fact that ui-sref is not firing on my first click, but only on the second one. When I remove one of the resolves in the state, the problem is gone.
I would appreciate your help on this one!


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>