I've followed the steps to upgrade from the Angular2 beta 27 to RC4, however I'm stuck with that error:
Uncaught (in promise) Error: (SystemJS) reflect-metadata shim is required when using class decorators
My current setup is javascript commonjs modules created from typescript and then put in javascripts/lib/angular2, I've followed advices from https://gist.github.com/robwormald/429e01c6d802767441ec and from Angular2 + Jspm.io : reflect-metadata shim is required when using class decorators but it did not help.
System.config({
packages: {
app: {
format:'register',
defaultExtension:'js'
},
'@angular/core' : {defaultExtension: 'js', main: 'index.js'},
'@angular/common' : {defaultExtension: 'js', main: 'index.js'},
'@angular/compiler' : {defaultExtension: 'js', main: 'index.js'},
'@angular/router' : {defaultExtension: 'js', main: 'index.js'},
'@angular/router-deprecated' : {defaultExtension: 'js', main: 'index.js'},
'@angular/http' : {defaultExtension: 'js', main: 'index.js'},
'@angular/platform-browser' : {defaultExtension: 'js', main: 'index.js'},
'@angular/platform-browser-dynamic': {defaultExtension: 'js', main: 'index.js'}
},
map: {
'@angular': 'javascripts/lib/angular2'
}
});
System.paths['angular2/*'] = '/javascripts/lib/angular2/*.js';
System.paths['rxjs/*'] = '/javascripts/lib/rxjs/*.js';
System.import("@angular/core").then(function(ng2) { // angular2/core
System.import('javascripts/app');
});
As advised on many stackoverflow responses, I've tried to add (because Angular2 release candidate removed angular2-polyfills) that into the top of my app.ts file, but it doesn't help (of course I have re-generated the js file with typescript)
import 'reflect-metadata';
require('zone.js/dist/zone');
I'll add more details as long I try more potential solutions.
Thank you for your help.