Closed 404157386 closed 5 years ago
It can run successfully after add the rxjs package at System.config:
packages: {
+ 'rxjs' : {main: 'bundles/Rx.js'},
'@angular/core' : {main: 'index.js'},
'@angular/common' : {main: 'index.js'},
'@angular/compiler' : {main: 'index.js'},
'@angular/platform-browser' : {main: 'index.js'},
'@angular/platform-browser-dynamic': {main: 'index.js'}
}
or
add rxjs to script tag directly and remove System.config:
<script src="//unpkg.com/core-js/client/shim.min.js"></script>
<script src="//unpkg.com/zone.js@0.8.4"></script>
<script src="//unpkg.com/typescript@2.0.0"></script>
<script src="//unpkg.com/systemjs@0.19.37/dist/system.src.js"></script>
+ <script src="//unpkg.com/rxjs@5.0.0-beta.0/bundles/Rx.js"></script>
<script>
System.config({
transpiler: 'typescript',
typescriptOptions: {emitDecoratorMetadata: true},
map: {
- 'rxjs': 'https://unpkg.com/rxjs@5.0.0-beta.12',
'@angular/core' : 'https://unpkg.com/@angular/core@2.0.0',
'@angular/common' : 'https://unpkg.com/@angular/common@2.0.0',
'@angular/compiler' : 'https://unpkg.com/@angular/compiler@2.0.0',
'@angular/platform-browser' : 'https://unpkg.com/@angular/platform-browser@2.0.0',
'@angular/platform-browser-dynamic': 'https://unpkg.com/@angular/platform-browser-dynamic@2.0.0'
},
packages: {
'@angular/core' : {main: 'index.js'},
'@angular/common' : {main: 'index.js'},
'@angular/compiler' : {main: 'index.js'},
'@angular/platform-browser' : {main: 'index.js'},
'@angular/platform-browser-dynamic': {main: 'index.js'}
}
});
System.import('main.ts');
</script>
They all can work. Can you update your code, please?
Yea, can you update your code?)
Please use the code samples for the second edition of this book at https://github.com/Farata/angulartypescript.
They all hit error:
GET https://unpkg.com/rxjs@5.0.0-beta.12/Subject 404 ()
Please check, thank you!