problems with angular onload html 2 (typescript) [closed]

0

Colleagues, I have a problem, I want to do a trivia with dynamic questions in a single page, at the beginning I need to execute a function to assign value to some variables in the html, but the onload does not work for me. this is html with typescrypt with angular2. Any suggestions? TS code

    
asked by Jonathan Aguirre 15.04.2017 в 19:08
source

1 answer

0

I am seeing that you are using Ionic, in this framework there are "Lifecyle events", which are methods that are triggered during the life cycle of each view.

Try instead of calling it from the view, make the call to your method from your controller, probably using " ionViewDidLoad() " or " ionViewDidEnter() " depending on which best suits your needs.

I leave the link to the documentation, look in that same page Lifecycle Events and tell me if it solves your problem:)

link

    
answered by 15.04.2017 / 19:22
source