angular2抽取公共复用组件(模块间公用)
例如创建footer组件
- ng g c footer –module
- footer.component.spec.ts (测试文件)
- *footer.component.ts (ts组件文件)
-footer.module.ts (模块文件)

具体代码
footer.component.ts
代码块
import { Router } from '@angular/router';
@Component({
selector: 'app-footer',
template: `
<div class="row login_footer">
<ul

本文介绍如何在Angular2中抽取出公共组件,如footer,详细讲解了从生成组件到创建模块文件的过程,并提供了具体的代码示例。通过模块文件引入,其他模块可以方便地复用这些公共组件。
最低0.47元/天 解锁文章
943

被折叠的 条评论
为什么被折叠?



