参数assetDetailController不是未定义的函数

时间:2016-07-07 15:57:04

标签: javascript angularjs jasmine

我在Angular.js中比较新,所以我尝试了所有其他解决方案,但它总是抛出一个错误assetDetailController不是一个未定义的函数..任何建议我在这个网站上尝试了所有可能的解决方案..

 describe('asset detail Controller',
        function () {
            describe('assetDetailController',
                function () {
                    var scope;
                    var rportService;
                    var controller;
                    var $q;
                    var deferred, assetId, rootScope;
                    var httpMock, data;

                    beforeEach(module('app'));

                    // inject the required services and instantiate the controller
                    //beforeEach();

                    describe('asset detail Controller 2',
                        function () {
                            deferred = null;

                            //beforeEach();

                            //beforeEach(angular.mock.inject(function ($q) {

                            //}));

                            beforeEach();

                            it('test to be called with',
                                function ( done) {
                                    angular.mock.inject(function ($rootScope, $controller, reportService, $q, $httpBackend) {
                                        scope = $rootScope.$new();
                                        rportService = reportService;
                                        controller = $controller('assetDetailController',
                                        {
                                            $scope: scope,
                                            assetId: assetId,
                                            reportService: rportService,
                                            rootScope: $rootScope
                                        });

0 个答案:

没有答案