moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
323 stars 129 forks source link

Compatibility with Ionic 2 RC0 #20

Closed Tiuser4567 closed 7 years ago

Tiuser4567 commented 7 years ago

Hello,

I am using ng2-idle in my ionic 2 beta project. Currently, we are in the process of migrating to ionic 2 RC0 (which updated to Angular 2.0.0 AOT from Angular 2 RC4 ) However, currently, I'm encountering 2 kinds of errors when I include ng2-idle providers.

error in ionic serve command:

bundle dev started... Error reading template file, "my-component-tpl.html": Error: ENOENT: no file or directory, open 'ionic_app\node_modules\ng2-idle\node_modules\@angular\core\src\animation\my-component-tpl.html'

Error reading template file, "my-component-tpl.html": Error: ENOENT: no file or directory, open 'ionic_app\node_modules\ng2-idle-keep-alive\node_modules\@angular\core\src\animation\my-component-tpl.html'

Error reading template file, "my-component-tpl.html": Error: ENOENT: no file or directory, open 'ionic_app\node_modules\ng2-idle-keepalive\node_modules\@angular\http\src\people.html'

error in browser console

"Unhandled Promise rejection: No provider for Http!; Zone: ; Task: Promise.then; Value:"

My app.module.ts

@NgModule({
  declarations: [ MyApp ] 
  imports: [IonicModule.forRoot(MyApp), HttpModule]
  bootstrap: [IonicApp],
  entryComponents: [MyApp],
  providers: [IDLE_PROVIDERS, KEEP_ALIVE_PROVIDERS]
})
export class AppModule {}

(I'm not familiar yet with the changes in Angular 2.0.0 but I'm guess AOT compiling used by Ionic 2 RC0 may be a factor?)

Can anyone advise? Thanks

Tiuser4567 commented 7 years ago

update; followed workaround by elvirdolic in #17 (and did not use ng2-idle-keepalive).

Though still encountering below in the 'ionic serve' command.

Error reading template file, "my-component-tpl.html": Error: ENOENT: no file or directory, open 'ionic_app\node_modules\ng2-idle\node_modules\@angular\core\src\animation\my-component-tpl.html'

Not sure if above can be ignored but so far the app and idle functionality works when tested in the browser.

Tiuser4567 commented 7 years ago

Update: above error is an issue by ionic CLI (apparently it is misreading commented @Component code). closing this issue (as I can proceed with the workaround)