0
我已經實現了ngrx-store。我試圖在http調用之前打開微調器。並在通話結束後將其關閉。
getInspectionDetails(order) {
this.store.dispatch({ type: SPINNER_VISIBLE, payload: true }) //<-- spinner on
return this.$http.get(this.url+'api/Inspection/'+order.documentNumber)
.map(this.httpHelper.extractData)
.catch(this.httpHelper.handleError)
.map(payload => ({ type: INSPECT_PURCHASE_ORDER, payload }))
.subscribe(action => this.store.dispatch(action))});
}
現在我嘗試使用
this.store.dispatch({ type: SPINNER_VISIBLE, payload: false })
關閉微調。基本上這是與假負載相同的調用來關閉微調器。 但我應該把這個放在哪裏?
我想你可以添加。最後(()=> turnOffSpinner) – Vega