打開角cli.json文件,匹配的文件,並替換代碼: -
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "project name"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css",
"../node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/bootstrap/dist/js/bootstrap.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}
什麼是你所面臨的問題是什麼?任何錯誤或語言環境文件未加載?你能否請檢查一下js或locale文件是否正確添加? – Shad
發佈您的'angular-cli.json'和一些代碼。對於我在文檔中可以看到的內容,您只需指定您想要的語言環境。 – nuvio