angular 9打造用户系统 - 2使用ngrx store和reducer来加载用户列表
angular 9打造用户系统-2
本片使用ngrx store和ngrx reducer加载用户列表
github代码:https://github.com/shyandsy/angular-9-ngrx-user-mamagement
原教程视频连接
https://www.youtube.com/watch?v=ChiAZJiX3v0&list=PLaMbwDs23r4KXoMucJEyUAvamQ-kFNBvC&index=4
步骤
安装ngrx依赖
npm install @ngrx/store @ngrx/effects @ngrx/entity @ngrx/store-devtools @ngrx/router-store
创建第一个action和reducer
创建src\app\users\user.model.ts
import { Time } from '@angular/common'
export interface User{
id?: number;
username: string;
cnname: string;
enname: string;
password?: string;
role_id: number;
email: string;
t...