国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

angular.js - angular 指令中包含webworker 在單元測試中一直報找不到worker 文件錯誤 如何解決?

瀏覽:181日期:2024-03-20 13:56:12

問題描述

//directive.js var option = { ’typeNumber’: 4, ’errorCorrectLevel’:’L’, ’text’: $scope.text }$scope.worker = new Worker(’/js/myworkers.js’);$scope.myworker.postMessage(option);//test.jsdescribe(’Directives test’, function(){ var $compile, $scope, $templateCache, $httpBackend,workerValue,$timeout; beforeEach(module(’directives’)); ... ... ...it(’qrcode test’, function(){$httpBackend.expectGET(’webroot/js/myworkers.js’).respond(200,’woker’);var link = $compile(’<my-qrcode value='qrcode_text' change='false'></my-qrcode>’);var element = link($scope);$scope.$digest();console.log(element.html());//expect(element.html()).toEqual(workerValue)});//karma.conf.js... // list of files / patterns to load in the browser files: [ ’testjs/jquery.js’, ’webroot/js/lib/angular/angular.js’, ’webroot/js/lib/angular/angular-route.js’, // ’webroot/js/lib/angular/angular-animate.js’, ’webroot/js/lib/angular/angular-resource.js’, ’webroot/js/lib/angular/angular-sanitize.js’, ’webroot/js/lib/angular/*.min.js’, ’webroot/js/lib/bootstrap-ui/*.js’, // ’webroot/js/lib/angular/angular-loader.js’, ’webroot/js/lib/angular/angular-mocks.js’, ’webroot/js/myworkers.js’, ’webroot/js/bootstrap.js’, ’webroot/js/services.js’, ’webroot/js/directives.js’, ’webroot/js/filters.js’, ’webroot/js/app.js’, ’webroot/js/controllers.js’, ’testjs/*.js’ ], ...

報錯報錯提示

angular.js - angular 指令中包含webworker  在單元測試中一直報找不到worker 文件錯誤 如何解決?][2]

debug中的 resource

angular.js - angular 指令中包含webworker  在單元測試中一直報找不到worker 文件錯誤 如何解決?

我看到有人說 這樣就可以了但是現在不行 誰能說說這是什么情況嗎??怎么解決呢??

問題解答

回答1:

..把路徑寫好就好了。。。。 new work('base/webroot/js/myworker.js')

標簽: web
相關文章:
主站蜘蛛池模板: 体育| 交城县| 福建省| 墨脱县| 什邡市| 鄂温| 樟树市| 越西县| 平乡县| 金华市| 安多县| 广平县| 岢岚县| 阳曲县| 巢湖市| 三都| 盐边县| 临武县| 哈密市| 蓬莱市| 定远县| 贡觉县| 开封县| 丰顺县| 岚皋县| 晋城| 信丰县| 郓城县| 华容县| 沾益县| 昌宁县| 广西| 县级市| 同心县| 大石桥市| 绩溪县| 镇坪县| 社会| 高唐县| 延川县| 阳曲县|