rhy*_*lay 3 observable angular
我试图在可观察对象完成后实现一个简单的回调,这是我的代码:
ngOnInit() {
this.propertyService
.getProperties()
.subscribe(
(data: ContentPropertyModel[]) => this.properties = data
);
this.status = 'active';
}
Run Code Online (Sandbox Code Playgroud)
但是,状态在可观察运行之前已更改。关于如何在可观察到的运行后如何更改this.status的任何想法?
移至this.status
您的订阅处理程序:
ngOnInit() {
this.propertyService
.getProperties()
.subscribe(
(data: ContentPropertyModel[]) => {
this.properties = data
this.status = 'active';
}
);
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4538 次 |
最近记录: |