I have the following simple JavaScript to run, referring to a element inside an angular view:
var buttons = document.querySelectorAll('.msg-type i');
console.log(buttons.length);
It print on the console 0, which is wrong (there are 3 elements on the page).
The problem is, my script is included in the index page, not in the view itself, and I don't want to fragmentate my script to avoid too much HTTP requests and so reducing load time.
How can I run the script when my view load?