gpt4 book ai didi

html - 尝试将组件添加到模块文件时在 Stackblitz 上导入错误

转载 作者:太空宇宙 更新时间:2023-11-04 00:38:10 25 4
gpt4 key购买 nike

我正在使用 Stackblitz 练习 angularJS,当我尝试在 app.module.ts 文件中导入组件时出现错误。

Import error, can't find file:
./heroes/heroes.component

应用程序模块.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';

import { AppComponent } from './app.component';
import { HelloComponent } from './hello.component';
import { HeroesComponent } from './heroes/heroes.component';

https://stackblitz.com/edit/angular-akxx4e?file=src%2Fapp%2Fapp.module.ts

最佳答案

更新下面的变化,因为它在不同的文件夹中

import { HeroesComponent } from '../heroes/heroes.component';

关于html - 尝试将组件添加到模块文件时在 Stackblitz 上导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58930678/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com