我正在学习 angular,我正在尝试将资产文件夹内的本地图像加载到 main.component.html 中,并且我已经正确设置了路径,同时我在打开图像的路径上执行 alt+单击。但是图像没有加载到浏览器上。
在 Chrome 开发者工具的源选项卡中,没有 包含资产文件夹
我试过这个https://github.com/angular/angular-cli/issues/5268但没有用,有人请帮忙这是我的 angular.json 文件
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"game-of-thrones": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/game-of-thrones",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/font-awesome/css/font-awesome.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js"
]
},
"configurations": …Run Code Online (Sandbox Code Playgroud)