christopherthielen / ui-router-extras

THIS PROJECT IS NO LONGER MAINTAINED -- Extras for UI-Router for AngularJS. Sticky States (a.k.a. parallel states), Deep State Redirect (for tab-like navigation), Future States (async state definition)
http://christopherthielen.github.io/ui-router-extras/
MIT License
917 stars 211 forks source link

Error: [$injector:modulerr] Failed to instantiate module undefined due to: Error: [ng:areq] Argument 'fn' is not a function, got undefined #379

Open shrutivirani opened 6 years ago

shrutivirani commented 6 years ago

this both is controller ans test file of controller. i am running with "karma start --single-run" but it throws Error: [$injector:modulerr] Failed to instantiate module undefined due to: Error: [ng:areq] Argument 'fn' is not a function, got undefined at bower_components/angular/angular.js:125:12 at bower_components/angular/angular.js:5034:15 at forEach (bower_components/angular/angular.js:418:20) at loadModules (bower_components/angular/angular.js:4994:5) at Object.createInjector [as injector] (bower_components/angular/angular.js:4911:19) at UserContext.WorkFn (bower_components/angular-mocks/angular-mocks.js:3145:52)

controller.js

app.controller('dataEntryController', ['$cacheFactory', '$scope', 'productDataSvc', '$stateParams', '$state', '$rootScope', '$controller', 'GridDataService', 'bentoComboDataService', 'bmJobQueue', '$translate', '$injector', '$animate', '$q', '$timeout', 'AssociationService','errorAlertsFactory', 'dataEntryConfigService', 'bentoComboViewCacheService', function ($cacheFactory, $scope, productDataSvc, $stateParams, $state, $rootScope, $controller, GridDataService, bentoComboDataService, bmJobQueue, $translate, $injector, $animate, $q, $timeout, AssociationService, errorAlertsFactory, dataEntryConfigService, bentoComboViewCacheService) { //////////////////////////////////////// /// initialization //////////////////////////////////////// //$scope.debug = true; //$scope.debugWantPollingMessages = true; $scope.isLoaderBusyDE = true; $scope.onInshUpdate000 = false; $scope.doInshUpdate000 = false; $scope.pollingSuspended = false; $scope.unitsBeingAdded = new Set(); $scope.setBentoComboboxData = false; $scope.deferredPromisesToDestroy = []; $scope.previouslyHadData = $scope.currentlyHasData = false; ............... ............ ......... }

controller_test.js

var $cacheFactory, $scope, productDataSvc, $stateParams, $state,$rootScope, $controller, GridDataService, bentoComboDataService, bmJobQueue, $translate, $injector, $animate, $q, $timeout, AssociationService, errorAlertsFactory, dataEntryConfigService, bentoComboViewCacheService;

beforeEach(inject(function (_$cacheFactory_, _productDataSvc_, _$stateParams_, _$state_,
    _$rootScope_, _$controller_, _GridDataService_, _bentoComboDataService_, _bmJobQueue_, _$translate_, _$injector_, _$animate_, _$q_, _$timeout_, _AssociationService_, _errorAlertsFactory_, _dataEntryConfigService_, _bentoComboViewCacheService_) {
       $scope: $rootScope.$new();
       dataEntryConfigService = _dataEntryConfigService_;
       $cacheFactory = $cacheFactory,
        productDataSvc = productDataSvc,
        $stateParams = $stateParams,
        $state = $state,
        $rootScope = $rootScope,
        GridDataService = GridDataService,
        bentoComboDataService = bentoComboDataService,
        bmJobQueue = bmJobQueue,
        $translate = $translate,
        $animate = $animate,
        $q = $q,
        $timeout = $timeout,
        AssociationService = AssociationService,
        errorAlertsFactory = errorAlertsFactory,
        bentoComboViewCacheService = bentoComboViewCacheService
        $controller = _$controller_('dataEntryController', {

    });
}));

describe("data entry controller", function () {

    it("should be created successfully", function () {
        expect("hello").toBe("hello");
    });
});

});