Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : When using a Component, when do I choose between the init method of the component or the init method of the events object?

$
0
0
scope has init method, it is called prior rendering and inserting the element.

events has 'inserted' event (method), that is called when element was inserted into DOM.

So if you need initial manipulations with data use scope's init, if you need some DOM related stuff do it in inserted event.

Viewing all articles
Browse latest Browse all 3491

Trending Articles