PatrickJS / angular-hmr

:fire: Angular Hot Module Replacement for Hot Module Reloading
https://patrickjs.com
Apache License 2.0
506 stars 45 forks source link

RC5 Support #20

Closed FabioAntunes closed 8 years ago

FabioAntunes commented 8 years ago

Does angular2-hmr supports RC5? If so does anyone has an example?

I tried doing this:

export function main(initialHmrState?: any): Promise<any> {
  return platformBrowserDynamic().bootstrapModule(AppModule).catch(err => console.error(err));
}

if (process.env.ENV !== 'build') {
  // activate hot module reload
  let ngHmr = require('angular2-hmr');
  ngHmr.hotModuleReplacement(main, module);
} else {
  // bootstrap when document is ready
  document.addEventListener('DOMContentLoaded', () => main());
}

But then I get this whenever I change one file: webpack-hmr.js:73 Uncaught TypeError: Cannot read property 'nativeElement' of undefined

PatrickJS commented 8 years ago

thanks, fixed. here's an example of the new api https://github.com/AngularClass/angular2-seed/blob/e5c2c3c2b8d8a96420d59d21f8e040a8f9d634c1/src/main.browser.ts#L34...L51

FabioAntunes commented 8 years ago

@gdi2290 is the @angularclass/hmr the new namespace? Because npm can't find that

PatrickJS commented 8 years ago

@FabioAntunes ya sorry I published it and the default was private so it's public now