To form our application, we need to familiarize ourselves with the order of initialization of the wrapper and its binding to the DOM element.
At the beginning of the HTML, the code is placed in the body of the page, after which the wrapper is created and the
During initialization and update, the wrapper performs template binding during which DOM events are bound, nested HTML JavaScript blocks are executed, and nested templates are created and initialized. During this process, the
The template can be updated automatically when the template arguments are updated (if the autoUpdate template option is true) or when the
Destruction of the wrapper occurs automatically when the template DOM element disappears from the page, this is done by the built-in garbage collector or if the template was removed in a rerender event.. Therefore, it is important that the DOM element be on the page as long as the template needs to exist. The actual destruction of the wrapper is performed by calling the