[英]Which Angular CLI command can I use to move a newly created component under a folder?
I have created two components in my Angular Project based on the requirement.我根据要求在我的 Angular 项目中创建了两个组件。 I need to show these components under a specific folder so that I can relate it easily while working on another modules.Please let me know if there is any command which can fulfill my requirement.
我需要在特定文件夹下显示这些组件,以便在处理其他模块时轻松关联它。如果有任何命令可以满足我的要求,请告诉我。
Components are: user-list and user-single Folder Name: Users组件是:用户列表和用户单个文件夹名称:用户
These are just some files inside a folder. 这些只是文件夹中的一些文件。 In windows, you can use the move command to move them to the appropriate directory.
在Windows中,可以使用move命令将它们移动到适当的目录。 Or you can just delete the component, and generate a new one in your required directory.
或者,您可以删除该组件,然后在所需目录中生成一个新组件。 Either way works!
无论哪种方式都行!
如果您使用 VSCode,您可以从 Code 的资源管理器中移动文件夹,它通常足够智能以更新文件导入。
I just figured out that moving a component into another folder (eg components) within VS Code will course a real strange compilation problem.我刚刚发现将一个组件移动到 VS Code 中的另一个文件夹(例如组件)会导致一个真正奇怪的编译问题。 Moving that component back where it was does not solve the problem :-/
将该组件移回原来的位置并不能解决问题:-/
move your component folder to another folder and go to the app.module.ts and redefine the new location将您的组件文件夹移动到另一个文件夹,并将 go 移动到 app.module.ts 并重新定义新位置
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HeaderComponent } from './header/header.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { ToolbarComponent } from './toolbar/toolbar.component';
import { ContentComponent } from './content/content.component';
import { FooterComponent } from './content/footer/footer.component';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.