我想导入xlsx
.
所以,我安装xlsx
使用npm install xlsx
.
并导入xlsx
模块。import * as XLSX from 'xlsx';
(我也试试import { foo, bar } from 'xlsx';
)
并使用 Angular cli 运行此代码。ng serve
.
我用这个。
Angular CLI: 1.6.1
Node: 6.11.3
OS: win32 x64
Angular: 2.4.10
... common, compiler, compiler-cli, core, forms, http
... platform-browser, platform-browser-dynamic
@angular/cli: 1.6.1
@angular/router: 3.4.10
@angular/tsc-wrapped: 0.5.2
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.1
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.0.10
webpack: 3.10.0
请帮忙。谢谢。