Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@OnPageVisible() doesnt work with class instances #4

Closed
basketofsoftkittens opened this issue Jun 2, 2018 · 3 comments
Closed

@OnPageVisible() doesnt work with class instances #4

basketofsoftkittens opened this issue Jun 2, 2018 · 3 comments

Comments

@basketofsoftkittens
Copy link

you cannot decorate a method with @OnPageVisible() and access this from inside that method

@olivierlsc
Copy link
Owner

olivierlsc commented Jun 4, 2018

@basketofsoftkittens ,

It works for me. Did you import AngularPageVisibilityModule ? Can you give me an example of your source code ?

@realgsong
Copy link

Same here. I have imported AngularPageVisibilityModule.

export class TestComponent{
...
    @OnPageVisible()
    pageVisible(): void {
        this.isPageVisible = true;
    }
}

"this" is undefined.

@olivierlsc
Copy link
Owner

Thanks @basketofsoftkittens , @realgsong !

Fixed in version 4.0.13 for Angular 4 to 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants