简体   繁体   中英

I seem to be gettting an unknown provider error when I am trying to call the config provider in ionic

I seem to be gettting an unknown provider error when I am trying to call the config provider

Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to: Error: [$injector:unpr] Unknown provider: $ionicConfigProvider

.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {

    // Turn off caching for demo simplicity's sake
    $ionicConfigProvider.views.maxCache(0);
    $ionicTabsConfig.type = '';
    $ionicConfigProvider.tabs.style(standard);
    /*
    // Turn off back button text
    $ionicConfigProvider.backButton.previousTitleText(false);
    */




    $stateProvider.state('app', {
        url: '/app',
        abstract: true,
        templateUrl: 'templates/menu.html',
        controller: 'AppCtrl'
    })

    .state('app.activity', {
        url: '/activity',
        views: {
            'menuContent': {
                templateUrl: 'templates/activity.html',
                controller: 'ActivityCtrl'
            },
            'fabContent': {
                template: '<button id="fab-activity" class="button button-fab button-fab-top-right expanded button-energized-900 flap"><i class="icon ion-paper-airplane"></i></button>',
                controller: function ($timeout) {
                    $timeout(function () {
                        document.getElementById('fab-activity').classList.toggle('on');
                    }, 200);
                }
            }
        }
    })
});

Seems like you are missing to add dependency of $ionicTabsConfig in your config block

.config(function($stateProvider, $urlRouterProvider, $ionicTabsConfig, $ionicConfigProvider) {

    //... You config code remains as is


});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM