Ember 2.x: browsing is out of date, use component instead
You need to understand the component life cycle in order to know when certain things happen.
Because components are rendered, redisplayed, and permanently deleted, Ember provides lifecycle bindings that let you run code at a specific time in the component resource.
https://guides.emberjs.com/v2.6.0/components/the-component-lifecycle/
As a rule, didInsertElement is a great place to integrate with third-party libraries.
This hook guarantees two (2) things,
- The component element was created and inserted into the DOM.
- The component element is accessible through the
$() component.
You need JavaScript to execute whenever attributes change
Run the code inside didRender .
Read the above life cycle document again for more information.
Xinyang Li Feb 20 '17 at 7:05 2017-02-20 07:05
source share