After creating the instance we need to use them in the ngOninit () life cycle hook. In Angular you can use ViewChild and ElementRef: If the element is in a different component you can reference it several different ways as seen in this question. Are there tables of wastage rates for different fruit and veg? Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. Lewis Fairweather 602 Followers Software Engineer | Co-Founder @ tripapt.com More from Medium fatfish in Frank Modica Sep 19, 2017 at 15:42 1 rev2023.3.3.43278. (Remeber to add id="