在app.module.js中的Ionic 3中导入Angular指令

时间:2018-05-26 12:16:48

标签: angular ionic-framework ionic2

我正在尝试添加一个npm package,它会自动滚动到离子3中元素的底部。导入后我一直收到错误:

错误

  

scrollglue.js:164未捕获的ReferenceError:未定义角度

app.module.js

    import { NgModule, ErrorHandler } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
    import { HttpClientModule } from '@angular/common/http';
    import { MyApp } from './app.component';
    //trying to import this angular directive 
    import { GlueScroll } from 'angularjs-scroll-glue';


    ....

  declarations: [
    MyApp,
    PaymentPage,
    PaypalPage,
    AboutPage,
    GlueScroll
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    BrowserAnimationsModule,
    IonicModule.forRoot(MyApp,  {
        tabsHideOnSubPages: true,
    }),
    NgCircleProgressModule.forRoot({
        showTitle: false,
        showSubtitle: false,
        showUnits: false,
        space: -6,
        backgroundPadding: -4,
        backgroundStrokeWidth : -3
    }),
    PipesModule
  ],

Plunker

http://plnkr.co/edit/wxTyp7PpyxJOHSlUumVC?p=preview

0 个答案:

没有答案