7
A
回答
4
Index.html
是開始,它連續main.ts
然後將其去與<my-app>
和推移和
的Index.html後,systemjs.config.js
被加載。它告訴哪個文件運行。並在systemjs.config.js
,它告訴加載main.ts
開始。
包告訴系統如何加載器加載時沒有文件名和/或 沒有擴展名
經過一番研究,看看下面systemjs.config.js
文件。評論說明它的作用和時間。
/**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
//For android Internet
'moment': 'npm:moment',
'jquery':'npm:jquery/dist/jquery.js',
'fullcalendar':'npm:fullcalendar/dist/fullcalendar.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
moment: { main: './moment.js', defaultExtension: 'js' }
}
});
})(this);
'Index.html'是開始和它連續的'main.ts',然後它與''一起繼續並繼續。 –
Smit
這是如何工作的:https://wildermuth.com/2016/07/31/Is-Angular2-Too-Full-of-Ceremony – Smit
好的謝謝@Smit –