So, I see in a lot of places that if I want to pass a .ts variable to the HTML I have just to declare this var in the .ts page, set a value and then call this variable with {{}} in the HTML page.
I’m trying to populate a modal with some data that I already have, so the user can edit if he wants. I don’t know if I’m doing something wrong or if there is any change in ionic 4.
I already tried to define the variable value inside the constructor, inside the ngOnInit and with the variable definition above the constructor. The value just don’t pass, the “name” field keeps empty.
Basically just removing everything inside ngOnInit solved the problem. But I don’t know if is related to undefined values before the render because I use the async method to open/dismiss the modal. I really appreciate your help, thanks a lot! I hope this helps someone else in the future.
Another thing, to see the value in the view I need to pass the {{}} value inside the tag: <ion-input type="text" id="name" name="some_name" value="{{modalName}}">{{modalName}}</ion-input>