title: Trouble Using Microsoft BotFramework-WebChat in Angular 2 Application
body: <p>I'm having some trouble implementing the botframework into my angular application which is running locally, as per the docs </p>
  
  <h2>Easy: In your non-React website, run Web Chat inline</h2>
  
  <p><em>Add a DirectLine (not Web Chat) channel, and generate a Direct Line Secret. Make sure to enable Direct Line 3.0.</em></p>
  
  <p><em>Include botchat.css and botchat.js on your website, e.g.:</em></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
       &lt;link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" /&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;div id="bot"/&gt;
  &lt;script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    BotChat.App({
      directLine: { secret: direct_line_secret },
      user: { id: 'userid' },
      bot: { id: 'botid' },
      resize: 'detect'
    }, document.getElementById("bot"));
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now I've inserted my local path to the built CSS in the header as well as the js file, then in my component, I've declared the variable BotChat </p>
  
  <pre><code>declare var BotChat;
  </code></pre>
  
  <p>and then I've put the script in my constructor</p>
  
  <pre><code>constructor() {
      BotChat.App({
      directLine: { secret: direct_line_secret },
      user: { id: 'userid' },
      bot: { id: 'botid' },
      resize: 'detect'
    }, document.getElementById("bot"));
  }
  </code></pre>
  
  <p>but it doesn't seem to be working im getting this error in the console also</p>
  
  <pre><code>Loading failed for the &lt;script&gt; with source 
  “http://localhost:4200/BotFramework-WebChat-master/botchat.js”
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Error: [object Object]
  Stack trace:
  resolvePromise@http://localhost:4200/polyfills.bundle.js:7633:31
  </code></pre>
  
  <p>any help would be appreciated</p>