Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

SkyWaitService does not work in ngOnInit() #529

Closed
Blackbaud-MichaelSpires opened this issue Mar 29, 2017 · 3 comments
Closed

SkyWaitService does not work in ngOnInit() #529

Blackbaud-MichaelSpires opened this issue Mar 29, 2017 · 3 comments
Assignees

Comments

@Blackbaud-MichaelSpires

Expected behavior

SkyWaitService can block and unblock page during ngOnInit()

Actual behavior

Error: ApplicationRef.tick is called recursively

Steps to reproduce

Call this.waitSvc.beginBlockingPageWait() in ngOnInit()

Plunker (see example SKY UX 2 plunker template at: https://plnkr.co/edit/GeP22YbirEzceF3NVu39?p=preview)

https://plnkr.co/edit/izSTik4tPh1ugLA1FciB?p=preview

@Blackbaud-PatrickOFriel
Copy link
Contributor

I think this might have something to do with the fact the we're dynamically creating the page wait component the first time the service is called. This uses applicationRef which might be not a good thing to use within the component lifecycle. We might be able to get around this by putting the dynamic wait component creation within a timeout in the wait service code.

@Blackbaud-PatrickOFriel
Copy link
Contributor

Here's a workaround: https://plnkr.co/edit/8W8cdYBOslCP05nf1qYy?p=preview

Blackbaud-PatrickOFriel added a commit that referenced this issue Apr 13, 2017
* Start work for wait with absolute element

#546

* Add semi-transparent background for wait component

#545

* Ensure wait service can work in Angular lifecycle

#529

* fix unit tests

* update screenshots for new wait
@Blackbaud-PatrickOFriel
Copy link
Contributor

In 2.0.0-beta.18

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

No branches or pull requests

2 participants