title: Angular 2 load script after component render
body: <p>I m adding angular 2 in the HTML template with existing scripts (js files) by dividing the HTML into components. 
  All my scripts (present in Index.HTML) are loaded before the component is loaded and hence the scripts are unable to find the DOM elements.
  With the help of angular life cycle events, I have added the below code to load scripts</p>
  
  <pre><code>ngAfterContentInit() {
      // Load the script
      var self = this;
      self.script = &lt;HTMLScriptElement&gt;document.createElement("SCRIPT");
      self.script.src = '../Content/js/settings.js';
      self.script.type = 'text/javascript';
      document.getElementsByTagName("head")[0].appendChild(self.script);
  </code></pre>
  
  <p>Is this the right way to do it? Are there any alternatives to add script tags</p>