我有一个highcharts图表,可以作为独立的HTML文档。
当我尝试将其集成到Yeoman生成的Web应用程序基础结构中时,我收到错误:
ReferenceError: Highcharts is not defined
at HTMLDocument.eval (eval at <anonymous> (http://localhost:9000/bower_components/jquery/dist/jquery.js:343:5), <anonymous>:3:5)
at fire (http://localhost:9000/bower_components/jquery/dist/jquery.js:3187:31)
at Object.self.add [as done] (http://localhost:9000/bower_components/jquery/dist/jquery.js:3246:7)
at jQuery.fn.ready (http://localhost:9000/bower_components/jquery/dist/jquery.js:3496:25)
at jQuery.fn.init (http://localhost:9000/bower_components/jquery/dist/jquery.js:2927:10)
at jQuery (http://localhost:9000/bower_components/jquery/dist/jquery.js:75:10)
at eval (eval at <anonymous> (http://localhost:9000/bower_components/jquery/dist/jquery.js:343:5), <anonymous>:1:1)
at eval (native)
at Function.jQuery.extend.globalEval (http://localhost:9000/bower_components/jquery/dist/jquery.js:343:5)
at domManip (http://localhost:9000/bower_components/jquery/dist/jquery.js:5290:15) <div ng-view="" class="ng-scope" data-ng-animate="1">(anonymous function) @ angular.js:13550(anonymous function) @ angular.js:10225invokeLinkFn @ angular.js:9696nodeLinkFn @ angular.js:9093compositeLinkFn @ angular.js:8397publicLinkFn @ angular.js:8277lazyCompilation @ angular.js:8615boundTranscludeFn @ angular.js:8414controllersBoundTransclude @ angular.js:9143update @ angular-route.js:968Scope.$broadcast @ angular.js:17552(anonymous function) @ angular-route.js:643processQueue @ angular.js:15961(anonymous function) @ angular.js:15977Scope.$eval @ angular.js:17229Scope.$digest @ angular.js:17045Scope.$apply @ angular.js:17337done @ angular.js:11572completeRequest @ angular.js:11778requestLoaded @ angular.js:11711
exporting.js?_=1461240740374:9 Uncaught ReferenceError: Highcharts is not defined
在独立文档中,头文件如下所示:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
我在Yeoman Web应用程序视图中使用相同的头文件,但Bower似乎默认使用不同版本的Jquery,我得到了这个错误。
我该如何解决这个问题?