title: Require node module in angular2 component
body: <p>I can not figure out how to require node modules in my angular2 components - especially in my case on how to open a new electron window within an angular2 component.</p>
  
  <p>My component.html has something like this</p>
  
  <pre><code>&lt;button class="btn btn-success" (click)="buttonLoginClick()"&gt;Login&lt;/button&gt;
  </code></pre>
  
  <p>And within the component.ts I use the following</p>
  
  <pre><code>export class LoginComponent  {
    constructor() {}
  
    buttonLoginClick(): void {
      alert("just a test");
  
      const remote = require('electron').remote;
      const BrowserWindow = remote.BrowserWindow;
  
      var win = new BrowserWindow({ width: 800, height: 600 });
      win.loadURL('./test.html');
    }
  }
  </code></pre>
  
  <p>The error at compiling is saying </p>
  
  <blockquote>
    <p>Cannot find name 'require'.</p>
  </blockquote>