If you display content to your users, you should also be able to erase it. This is done via the destroy() method.
greeting.destroy();
First thing you see on destruction of a widget is calling destroy() on all its children. Then comes removal of itself from the DOM. In order to override destroy(), you need to set up permanent structures in init() or start(), however always remember to clean up since the garbage collector does not look after them.
Note- when overriding destroy(), _super() must always be called otherwise the widget and its children are not correctly cleaned up leaving possible memory.
0 Comment(s)