title: asp.net core, angular 2, PrimeNG
body: <p>I use <a href="https://www.npmjs.com/package/generator-aspnetcore-spa">aspnetcore-spa template</a> as starting point to create admin panel. 
  Next I add <a href="http://www.primefaces.org/primeng/#/setup">PrimeNG</a> library to use it's components.</p>
  
  <p>Unfortunately, when I import i.e. ButtonModule to app.module.ts and refresh, I get an error 'Event is undefined'. I can't figure out what is the reason for several days, so can anyone help me?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <ul>
  <li>So first of all I generate the stub with <code>yo aspnetcore-spa</code></li>
  <li>Next <code>npm install font-awesome primeng --save</code></li>
  <li><p>Then I add font-awesome and PrimeNG css files to <code>webpack.config.vendor.js</code></p>
  
  <pre><code> vendor: [
      '@angular/common',
      '@angular/compiler',
      '@angular/core',
      '@angular/http',
      '@angular/platform-browser',
      '@angular/platform-browser-dynamic',
      '@angular/router',
      '@angular/platform-server',
      'angular2-universal',
      'angular2-universal-polyfills',
      'bootstrap',
      'bootstrap/dist/css/bootstrap.css',
      'es6-shim',
      'es6-promise',
      'event-source-polyfill',
      'jquery',
      'zone.js',            
      'font-awesome/css/font-awesome.css',
      'primeng/resources/themes/sunny/theme.css',
      'primeng/resources/primeng.css'
  ]
  </code></pre></li>
  <li><p>Rebuild vendor dependencies <code>webpack --config webpack.config.vendor.js</code></p></li>
  <li>Then I import ButtonModule to app.module.ts</li>
  </ul>
  
  <p>Now if I start the app I'll get exception
  <a href="https://i.stack.imgur.com/no2zj.png"><img src="https://i.stack.imgur.com/no2zj.png" alt="Error page: ReferenceError: Event is not defined"></a></p>
  
  <p>Exception point to this fragment of code</p>
  
  <pre><code> __decorate([
      core_1.HostListener('mouseenter', ['$event']), 
      __metadata('design:type', Function), 
      __metadata('design:paramtypes', [Event]), 
      __metadata('design:returntype', void 0)
  </code></pre>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I've figured out that problem was in server-side rendering, so I removed it. It works for me, but it is still interesting how to solve this without turning of server-side rendering.</p>