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

When changeDetection is ChangeDetectionStrategy.OnPush component is not working #57

Open
ssljivic opened this issue Jul 23, 2017 · 1 comment

Comments

@ssljivic
Copy link

I'm submitting a ...

[x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[x] feature request

Current behavior
When used in inside a component with changeDetection: ChangeDetectionStrategy.OnPush loading bar does not work.

Reproduction of the problem
Place <ng2-slim-loading-bar></ng2-slim-loading-bar> inside a template of a component with changeDetection: ChangeDetectionStrategy.OnPush. Try start() - progress is updated, but component view is not reflecting that.

What is the expected behavior?
SlimLoadingBarComponent component should have changeDetection: ChangeDetectionStrategy.OnPush. It needs to inject private cd: ChangeDetectorRef and at the end of this.service.events.subscribe it should call this.cd.markForCheck();

What is the motivation / use case for changing the behavior?
This makes the component usable when changeDetection: ChangeDetectionStrategy.OnPush is used. Note that with redux/ngrx this change detection is very common.

Please tell us about your environment:

  • ng2-slim-loading-bar version: 4.0.0

  • Angular version: 4.0.1

  • Browser: all

  • Language: all

@ssljivic
Copy link
Author

@akserg any chance this PR can be merged and new release created soon?

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

Successfully merging a pull request may close this issue.

1 participant