import { StoreModule } from "@ngrx/store";
import { currentPurchase } from "../shared/index";
@NgModule({
imports: [
IonicModule.forRoot(MyApp, {}),
HttpModule,
StoreModule.provideStore({currentPurchase})
]
..
我得到Property currentPurchase' does not exist on type typeof app.module.
进口的减速器看起来像这样:
import { ActionReducer, Action } from "@ngrx/store";
import { ActionType } from "./action-type";
import { PurchaseModel } from "../purchase/purchase.model";
export const currentPurchase: ActionReducer<PurchaseModel> = (state:PurchaseModel = new PurchaseModel(), action:Action) => {
switch (action.type) {
case ActionType.SET_PURCHASE:
return (action.payload !== null) ? action.payload : new PurchaseModel();
case ActionType.UPDATE_PURCHASE:
return Object.assign({}, state, action.payload);
default:
return state;
}
};
还:
任何帮助表示赞赏。