【发布时间】:2017-01-12 13:28:25
【问题描述】:
我有一个添加新项目的模态(addProjectModal 组件)
save(data:Project) {
data.customer_id = this.customerID;
data.supervisor_id = 450;
this._projectService.addProject(data)
.subscribe(res => console.log(res)); //maybe init the refresh here
}
这个组件用在我保存项目数据的projectComponent中
ngOnInit() {
this.collapsedItem = -1;
this._projectService.getProjects(this.customerID)
.subscribe(data => {
this.projects = data
});
}
你会如何告诉父组件刷新(从数据库请求新数据)?
【问题讨论】: