-
-
Notifications
You must be signed in to change notification settings - Fork 241
Native element not available in AfterViewInit on android #848
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
Comments
@prolink007 I can confirm that this inconsistency i is observed on Android. e.g.
Test project demonstrating the issue here (remove the setTimeout to reproduce the problem in Android) |
I confirm the problem too. |
Hi - @tsonevn @NickIliev :) I have the same issue...But in my situation I need to do it with 500ms because I have a lot of info to load...and I am pretty sure that in slower and older device it probably won't be enough... Thanks guys :) |
A similar issue can be observed when nativeElement.android is accessed from a directive as shown below. The
|
Is there any update on this issue? I want to get the native view as it is loaded, but binding the loaded event breaks listviews (#1221) and using ngAfterViewInit just doesn't work on Android. This also means plugins that bind the loaded event (like nativescript-ng-shadow, nativescript-ngx-shadow and nativescript-ng-ripple) just flat out break your app in some situations. So i either have to add timeouts that might even break the code if a view is quickly created/destroyed, or add *ngIf everywhere potentially breaking component recycling. |
This seems to work under some conditions (perhaps not all):
|
Note the above strategy only works for UI components that have a |
are there any updates to the topic? As of today the bug seems still to exist |
@cjohn001 instead of using the top abstraction lifecycle events (meaning Angular and |
Hello Nicklliev, |
I am in the same situation as @cjohn001 |
I could use some guideline and I would be happy to try and fix this @NathanWalker @NickIliev |
Same problem, any update? |
From @prolink007 on June 15, 2017 15:44
The native element is not available inside AfterViewInit on Android but is available on ios.
For example:
label.android
will be undefined when running on android.label.ios
is defined when running on ios.I would expect EVERYTHING to be loaded and ready when
ngAfterViewInit
is fired. Because the view is supposed to be ready at that point.I know you can subscribe to
loaded
on the element to know when it is finished loading, but i would expectAfterViewInit
to be called after the entire "dom" is loaded and ready.Copied from original issue: NativeScript/NativeScript#4396
The text was updated successfully, but these errors were encountered: