Uncaught TypeError: Cannot read property 'Spread' of undefined with Angularjs

冷暖自知 提交于 2019-12-13 07:23:59

问题


I have an AngularJS project where I'm incorporating SpreadJS. I dynamically loading teh js and css files through gulp and these are loading into my main index.html file good. However when I try creating a new "spreadsheet" for the first time I get this error:

angular.gc.spread.sheets.10.0.0.min.js:41 Uncaught TypeError: Cannot read property 'Spread' of undefined at angular.gc.spread.sheets.10.0.0.min.js:41 at angular.gc.spread.sheets.10.0.0.min.js:1107

Right now I've removed the html and controller code for generating teh spreadsheet, but the error persists so it seems I didn't add the reference correctly. In my app module I juts added ' 'gcspreadsheets' as part of the modue definition:

   angular.module('sp', [

        'gcspreadsheets'
    ])

And again I have added these in the head of my index.html:

   <script src="/libs/spreadjs/angular.gc.spread.sheets.10.0.0.min.js"></script>
    <script src="/libs/spreadjs/gc.spread.sheets.all.10.0.0.min.js"></script>

Any thoughts of why this could be coming? I'm using the trial version for now prior to buying.


回答1:


Please switch the order of the script references

Hope this helps

GC SpreadJS



来源:https://stackoverflow.com/questions/42493685/uncaught-typeerror-cannot-read-property-spread-of-undefined-with-angularjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!