Angular从另一个组件和服务

时间:2018-04-08 21:43:22

标签: angular data-binding parent-child angular-services angular-components

应用程序的结构包含projects组件,其中包含projecttasks组件,其中包含子组件task-detail,还有另一个名为{{1的模块与服务和应用程序模型共享的文件夹:

structure of the angular app

我尝试从不同的地方(从其父组件schedule以及task-detail通过按钮)初始化tasks组件。我使用ScheduleServiceproperty binding

管理了第一个解决方案

tasks.component.html

Input

任务detail.component.ts

<app-task-detail *ngIf="selectedTask" [task]="selectedTask?.schedules"></app-task-detail>

但我不能点击按钮。

这是stackblitz。我试图获得相同的结果(任务明细!)点击按钮或选择任务(现在可以使用)。

0 个答案:

没有答案
相关问题