Install angular module in Ionic 3.5


#1

Hi, I am a noob with ionic, i need use this angular module

I already installed with the command

$ npm install angular-bootstrap-grid-tree

in app.module.ts import the module

import { treeGrid } from 'angular-bootstrap-grid-tree';

NgModule({
  declarations: [
    MyApp,
    SalesPage,
    ItemDetailsPage,
    ListPage
  ],
  imports: [
    BrowserModule,
    treeGrid,
    HttpModule,
    IonicModule.forRoot(MyApp),
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    SalesPage,
    ItemDetailsPage,
    ListPage
  ],
  providers: [
    StatusBar,
    SagService,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]

but the app return this error

Runtime Error
angular is not defined
Stack
ReferenceError: angular is not defined
at http://localhost:8100/build/vendor.js:114375:5
at Object. (http://localhost:8100/build/vendor.js:115153:4)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at Object.215 (http://localhost:8100/build/main.js:242:87)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at Object.196 (http://localhost:8100/build/main.js:218:70)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at webpackJsonpCallback (http://localhost:8100/build/vendor.js:26:23)
at http://localhost:8100/build/main.js:1:1
Ionic Framework: 3.5.0
Ionic App Scripts: 2.0.1
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 6.10.3
OS Platform: macOS Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3153.4 Safari/537.36

Thank you for your great help


#2

That looks like it was made for Angular 1 (aka AngularJS), so it won’t work in Ionic 2+.


#3

Thank you… I very very noob :sweat_smile: