title: getting not defined error even though declared variable as declare var xyz in angular
body: <pre><code>declare
  var WhWidgetSendButton;
  
  ngOnInit() {
    var options = {
      facebook: "xxxx", // Facebook page ID
      whatsapp: "xxx", // WhatsApp number
      call_to_action: "Message us", // Call to action
      button_color: "#008000", // Color of button
      position: "left", // Position may be 'right' or 'left'
      order: "whatsapp,facebook", // Order of buttons
    };
    var proto = document.location.protocol;
    var host = "whatshelp.io";
    var url = proto + "//static." + host;
    let s = document.createElement('script');
    s.type = 'text/javascript';
    s.async = true;
    s.src = url + '/widget-send-button/js/init.js';
  
    s.onload = () =&gt; {
      WhWidgetSendButton.init(host, proto, options);
    };
    let x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(s, x);
  }
  </code></pre>