ng-connection-service | Detects active internet connection in Angular application | Dependency Injection library
kandi X-RAY | ng-connection-service Summary
kandi X-RAY | ng-connection-service Summary
Detects active internet connection in Angular application via DI ready Observable service.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ng-connection-service
ng-connection-service Key Features
ng-connection-service Examples and Code Snippets
Community Discussions
Trending Discussions on ng-connection-service
QUESTION
I have converted an Angular project into a hybrid app following this guide: https://medium.com/@christof.thalmann/convert-angular-project-to-android-apk-in-10-steps-c49e2fddd29
For Android I did not run into many issues and the app is working as expected on that platform.
On IOS I ran into multiple difficulties. First of all in order contents display I needed to change the Angular LocationStrategy to HashLocation as describe in this SO topic:
Why Angular Router 8 router ...
Although I now do get content to render I still have trouble getting the dynamic content (i.e. the content requiring a call to a web server before rendering) to render properly.
My app has got a classic NavBar to switch from one component to another. If I activate one component by clicking on a Nav Button the static content gets rendered ok. However, the dynamic content is not there. I can verify this by looking at the source code: The holding the dynamic content is empty. If I click on the same Nav Button again the dynamic content is added. I get the same effect on an iPhone simulator and on a real device.
This is the html of one of the components
...ANSWER
Answered 2021-Jan-06 at 15:45After a lot of trial and error and searching I found the solution.
I found a hint here:
https://github.com/angular/angular/issues/7381[1]
For a reason I fo not fully understand yet the app seems to switch zones during the async call to the server. Therefore the UI change mechanism is not triggered and the screen is not updated.
By wrapping the changes of variables into NgZone.run()
the screen is updated correctly.
The updated .ts file
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ng-connection-service
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page