Coder Social home page Coder Social logo

olivierlsc / angular-page-visibility Goto Github PK

View Code? Open in Web Editor NEW
14.0 0.0 9.0 3.24 MB

License: MIT License

TypeScript 84.88% JavaScript 9.63% HTML 5.21% Less 0.29%
typescript nodejs decorators module angular6 visibility pagevisibilityapi hidden visible prerender

angular-page-visibility's People

Contributors

anderstornkvist avatar dependabot[bot] avatar olivierlsc avatar tuffant21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-page-visibility's Issues

Ivy support?

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
}

Angular 7 support

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'.

Angular Universal Support

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

rxjs error

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'.

Angular 6 Compatibility

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!

typo in readme

this :

import { AngularPageVisibilityModule } from 'ngx-page-visibility';

should be :

import { NgxPageVisibilityModule } from 'ngx-page-visibility';

AoT compatibility

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 :)

Decorators doesnt work with Injectables

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.

Build error with aot support

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'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.