[英]HashLocationstrategy not working in angular 6 application
[英]SpreadJS not working in Webpack based angular application
我試圖將spreadjs庫添加到我的Angular 5應用程序中。 我正在遵循此鏈接中給出的教程。 https://www.grapecity.com/cn/blogs/spread-sheets-and-angular但是本教程與我的應用程序之間有一個區別。 我的應用程序正在使用webpack。
當我嘗試運行應用程序時,出現以下錯誤
未被捕獲的ReferenceError:GC未在對象上定義。 (gc.spread.sheets.angular.11.0.4.js:106)at webpack_require (bootstrap 05add16ed08b4def07f8:657)at fn(bootstrap 05add16ed08b4def07f8:85)at Object。 (app.module.browser.ts:21)在webpack_require (bootstrap 05add16ed08b4def07f8:657)在fn(bootstrap 05add16ed08b4def07f8:85)在Object處。 (index.js:4)在webpack_require (bootstrap 05add16ed08b4def07f8:657)在fn(bootstrap 05add16ed08b4def07f8:85)在Object.options.path(html5-entities.js:190)(匿名)@ gc.spread.sheets.angular。 11.0.4.js:106 webpack_require @引導程序05add16ed08b4def07f8:657 fn @引導程序05add16ed08b4def07f8:85(匿名)@ app.module.browser.ts:21 webpack_require @引導程序05add16ed08b4def07f8:657 fn @引導程序05add16ed08b4def8(anan bootstrap 05add16ed08b4def7。 JS:4 webpack_require @自舉05add16ed08b4def07f8:657 FN @自舉05add16ed08b4def07f8:85 options.path @ HTML5-entities.js:190 webpack_require @自舉05add16ed08b4def07f8:657 FN @自舉05add16ed08b4def07f8:85 裝飾@主client.js v = m6MAq5LYDxHuj3aQ3FLsDASzSdE0PXrpCFP8K7zsieI?: 4472 __webpack_require @引導程序05add16ed08b4def07f8:657 module.exports @引導程序05add16ed08b4def07f8:706(匿名)@引導程序05add16ed08b4def07f8:706
我嘗試將javascript鏈接添加到webpack.config.vendor.js 。 我的后端是.net核心webapi。 請告訴我下一步怎么辦
編輯
這可能是由於未在angular.json
文件中導入某些必需的腳本而angular.json
。 這是當前Angular應用程序缺少默認SpreadJS指令GrapeCity網站( https://www.grapecity.com/en/blogs/spread-sheets-and-angular )的步驟。
我在GrapeCity的Angular / SpreadJS博客之一( https://www.grapecity.com/en/blogs/create-angular-spreadsheets-with-angular-cli )上發現了這個缺少的步驟,該網站有些隱藏。
您需要執行的步驟是:
angular.json:
{
(…)
"apps": [
{
(…)
"styles": [
"./lib/gc.spread.sheets.excel2013darkGray.11.0.0.css"
],
"scripts": [
"./lib/gc.spread.sheets.all.11.0.0.min.js"
],
(…)
}
],
(…)
}
將文件路徑更改為您放置SpreadJS文件的位置。 請注意,至少在我的應用中,我的angular.json
文件具有兩個styles
數組和兩個scripts
數組-將這些引用插入頂部集合(最靠近angular.json
文件頂部的styles和scripts數組)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.