摘要: 直接code 1:Angular cli 创建组件component ng g component components\right ng g c wave 简写 需要定位到根路径下即可创建组件 Could not find an NgModule. Use the skip-import opti 阅读全文
posted @ 2024-06-20 17:09 天天向上518 阅读(18) 评论(0) 推荐(0) 编辑
摘要: Angular 兄弟组件之间的传值 在Angular中,兄弟组件之间直接传递数据并不直接支持,但可以通过以下几种方式实现通信: 1 使用服务(Service): 创建一个服务,用于存储和管理需要共享的数据。 在这个服务中定义一个BehaviorSubject或ReplaySubject(来自rxjs 阅读全文
posted @ 2024-06-20 16:44 天天向上518 阅读(9) 评论(0) 推荐(0) 编辑