olivierlsc / angular-page-visibility Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
It would be great to let the library support Angular 7. Currently it's not supported because of the peer dependencies: you just get errors:
ERROR in node_modules/angular-page-visibility/lib/angular-page-visibility.service.d.ts(1,10): error TS2305: Module '"C:/Projects/NGP/Frontend/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
Hi,
Angular page visibility does not work with SSR (universal) rendering.
At runtime we get
Error: document is not defined: Error during instantiation of AngularPageVisibilityService!. caused by: document is not defined
Thanks
It works for members of a component but not for injected services.
export class TestComponent{
...
@OnPageVisible()
pageVisible(): void {
this.isPageVisible = true;
}
@OnPageHidden()
pageHidden(): void {
this.testService.doSomthing().subscribe()
}
}
The OnPageVisible() works but OnPageHidden() throws this.testService is undefined.
hi do you have any idea about this error !?
ERROR in node_modules/angular-page-visibility/lib/angular-page-visibility.service.d.ts(1,10): error TS2305: Module '"/home/thunder/projects/pwa/pilapet-website/node_modules/rxjs/Observable"' has no exported member 'Observable'.
[ng] node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
when my browser is full screen then your library is not working.
npm WARN [email protected] requires a peer of @angular/common@^7.2.12 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^7.2.12 but none is installed. You must install peer dependencies yourself.
I couldn't wait so I forked it: https://github.com/Lauriy/angular-page-visibility
And published my own alias: https://www.npmjs.com/package/angular-page-visibilityx
Thanks for your work.
you cannot decorate a method with @OnPageVisible() and access this
from inside that method
When upgrading my project to Angular 6, I'm getting the following compile error:
ERROR in Error during template compile of 'AngularPageVisibilityModule'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'NgModule'
'NgModule' calls 'ɵmakeDecorator'.
Any ideas for how I can address this? Thanks!
When building with aot option, following error occurs. ng build --prod
ERROR in Error during template compile of 'AngularPageVisibilityModule'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'NgModule'
'NgModule' calls 'ɵmakeDecorator'.
this :
import { AngularPageVisibilityModule } from 'ngx-page-visibility';
should be :
import { NgxPageVisibilityModule } from 'ngx-page-visibility';
First off, awesome lib you made!! Many thanks!! Just a quick question / freature request; do you intent supporting AoT? If not, feel free to close the issue, if so, I'm looking forward to it :)
It seems that OnPageHidden doesn't work in iOS when minimizing mobile browsers like Chrome and Safari, I am working on disconnecting a web socket connection once the browser is minimized
I have Ivy enabled in my ng10 project and the lib seems to work fine - am I missing something or is the readme file maybe outdated?
And disable Ivy in tsconfig.json :
{
...
"angularCompilerOptions": {
...
"enableIvy": false
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.