title: Angular 11 HTML tag <script> equivalent
body: <p>In asp.net, I used to use this code</p>
  <pre><code>&lt;div&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;https://www.europetnet.org/epn-badge.js?IDC,grey&quot;&gt;&lt;/script&gt;
  &lt;/div&gt;
  </code></pre>
  <p>to display a badge from external source.</p>
  <p>This url contains following code:</p>
  <pre><code>var scripts = document.getElementsByTagName ('script');
  for (var s, i = scripts.length; i &amp;&amp; (s = scripts[--i]);) {
      if ((s = s.getAttribute ('src')) &amp;&amp; (s = s.match (/^(.*)epn-badge.js(\?\s*(.+))?\s*/))) {
          break;
      } 
  }
  
  var word = s[3];
  var isStyle = (word.indexOf(',') &gt;= 0) ? true : false;
  if( isStyle ) {
      var word = word.split(',');
      
      /* jQuery.ajax({
          type: 'POST',
          dataType: 'json',
          url: 'https://www.europetnet.org/update_badge.php',
          data: {badge: word[0]},
          success: function (data) {
              
          },
          error: function () {
          
          }
      }); */  
      
      var word = word[0]+'&amp;style='+word[1];
  }
  
  document.write('&lt;style type=&quot;text/css&quot;&gt;');
  document.write('#epnbadgeiframewrapper {');
      document.write('height: auto;');
  document.write('}');
  
  document.write('#epnbadgeiframe {');
      document.write('border: medium none;');
      document.write('width: 205px;');
      document.write('height: 35px;');
  document.write('}');
  document.write('&lt;/style&gt;');
  
  document.write('&lt;div id=&quot;epnbadgeiframewrapper&quot;&gt;&lt;iframe id=&quot;epnbadgeiframe&quot; src=&quot;//www.europetnet.org/epn-badge/epn-badge.php?id='+word+'&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;');
  </code></pre>
  <p>I try to do the same in Angular 11, but script tag is not allowed.</p>
  <p>I tried this code</p>
  <pre><code>  ngOnInit() {
      this.script = this.renderer2.createElement(&quot;script&quot;);
      this.script.type = &quot;text/javascript&quot;;
      this.script.src = &quot;https://www.europetnet.org/epn-badge.js?IDC,grey&quot;;
      this.script.text = ``;
      this.renderer2.appendChild(this.document.body, this.script);
  </code></pre>
  <p>I do not see how to use it in html template.</p>