微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javascript-Angular / Ui-Grid(ng-grid)/角度未定义

我正在尝试运行Angular的ui-grid并使用以下代码

import {NgModule} from "@angular/core";
import {browserModule} from "@angular/platform-browser";
import {RouterModule} from "@angular/router";

import {BosOverviewComponent} from "./bosoverview.component";

import {UiGridModule} from 'angular-ui-grid';

@NgModule({
  declarations: [
    BosOverviewComponent
  ],
  imports: [
    browserModule,
    RouterModule,
    UiGridModule
  ],
  exports: [
    BosOverviewComponent
  ],
})

export class BusinessObjectsModule {
}

使用npm start,我总是会遇到以下错误

Uncaught ReferenceError: angular is not defined
    at ui-grid.js:8
    at Object.../../../../angular-ui-grid/ui-grid.js (ui-grid.js:10)
    at __webpack_require__ (inline.bundle.js:55)
    at Object.../../../../angular-ui-grid/index.js (index.js:1)
    at __webpack_require__ (inline.bundle.js:55)
    at Object.../../../../../src/app/views/businessobjects/businessobjects.module.ts (bosoverview.component.ts:7)
    at __webpack_require__ (inline.bundle.js:55)
    at Object.../../../../../src/app/app.module.ts (app.helpers.ts:66)
    at __webpack_require__ (inline.bundle.js:55)
    at Object.../../../../../src/main.ts (environment.ts:8)

我该怎么办?谢谢!

解决方法:

当您是can see

UI-Grid is currently compatible with Angular versions ranging from 1.4.x to 1.6.x.

您正在尝试在Angular 2中使用它…

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐