-
-
Notifications
You must be signed in to change notification settings - Fork 241
TextField.android property not available in ngAfterViewInit() lifecycle hook #200
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
I tried it in a component loaded as the main app component, and it worked. I don't think we guarantee that |
I am not familiar with loaded event. do you mean ngOnInit()? It does not work there also. Actually my use case is like this. I am loading a route. Once the route is loaded, I am displaying a form to the user. The input fields in the form should have hint colors different than default. ngAfterViewInit is the hook where we know that input fields must have been initialized, so we can access the native elements. But in this hook, although the native elements are accessible, the android or ios property is not accessible. In your view, what is the best place to change the hint color when form is being loaded? |
I'm on the exact same situation, I'm using the setTextFieldColors function from the Tutorial but I want to change the colors as soon as the view gets rendered. |
I had to do a hack using settimeout:
This is working. But not sure if this is correct way. |
@sebastianteres @veenatic the I'll open a separate issue for supporting the |
yes, makes sense to use |
The text was updated successfully, but these errors were encountered: