Tag: ng bootstrap

错误TS2305:模块没有导出的成员

我正在做一个打字稿文件中的两个input: import { DOCUMENT } from '@angular/platform-browser'; import { Positioning } from '@ng-bootstrap/ng-bootstrap'; 第一条语句有效,但编译器会抱怨第二条语句(ng-bootstrap import): src/app/extensions/angular-calendar/directives/calendarTooltip.directive.ts(19,10): error TS2305: Module '"/Users/gg/OneDrive/Studies/Node/timely-frontend/node_modules/@ng-bootstrap/ng-bootstrap/index"' has no exported member 'Positioning'. 我已经checeked,我已经安装了ng-bootstrap。 我不知道这可能是什么原因。 以下是我的tsconfig.json文件: { "compilerOptions": { "outDir": "build/app", "target": "es5", "module": "system", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "gulpfile.ts", "node_modules" ] […]

Angular4 + Universal + ng-bootstrap导致“意外令牌导入”错误

所以我升级到了angular度4+,这样我就可以利用通用包进行服务器端渲染,以达到search引擎优化的目的。 我通过将其升级到angular度4+,并在https://github.com/evertonrobertoauler/cli-universal-demo/commit/a2610286bd3db5d4f4cce4318d7c220c11963eb6中完成了所有必要的configuration,在我现有的angular 2+项目中实现了该项目。 只有一个区别我正在使用ng-bootstrap https://ng-bootstrap.github.io/#/home(v1.0.0-alpha.22 )。 但是当我使用npm运行start-u-dev运行节点服务器时,我在ng-bootstrap中得到了导入关键字的这个错误。 app-ui@0.0.0 start-u-dev /Users/giric/Projects/apnaDoctor/webapp/appUI ts-node src/server.ts /appUI/node_modules/@ng-bootstrap/ng-bootstrap/accordion/accordion.module.js:1 (function (exports, require, module, __filename, __dirname) { import { NgModule } from '@angular/core'; ^^^^^^ SyntaxError: Unexpected token import at createScript (vm.js:53:10) at Object.runInThisContext (vm.js:95:10) at Module._compile (module.js:543:28) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) […]