1.0.7 • Published 6 years ago
ngxs-schematics v1.0.7
Install Angular CLI
You should be using @angular/cli@6.1.0
or newer.
npm i -g @angular/cli
Install NGXS Schematics
npm i -g @ngxs/schematics
Usage
Creating a new project
To generate new Angular project with NGXS Store, you can use ng new
with @ngxs/schematics
specified as the schematics collection.
ng new --collection=@ngxs/schematics my-app
Create a NGXS Store
To generate store with @ngxs/schematics
:
ng generate @ngxs/schematics:store --name todo
Result:
CREATE src/todo/todo.actions.ts
CREATE src/todo/todo.state.ts
Or with spec:
ng generate @ngxs/schematics:store --name todo --spec
Result:
CREATE src/todo/todo.actions.ts
CREATE src/todo/todo.state.spec.ts
CREATE src/todo/todo.state.ts
Create a NGXS State
To generate state with @ngxs/schematics
:
ng generate @ngxs/schematics:state --name todo
Result:
CREATE src/todo/todo.state.ts
Or with spec:
ng generate @ngxs/schematics:state --name todo --spec
Result:
CREATE src/todo/todo.state.spec.ts
CREATE src/todo/todo.state.ts
Create a NGXS Actions
To generate state with @ngxs/schematics
:
ng generate @ngxs/schematics:actions --name todo
Result:
CREATE src/todo/todo.actions.ts
NGXS Starter Kit
Usage
To generate store with @ngxs/schematics:starter-kit
:
ng generate @ngxs/schematics:starter-kit
Result:
CREATE src/store/store.config.ts
CREATE src/store/store.module.ts
CREATE src/store/auth/auth.actions.ts
CREATE src/store/auth/auth.state.ts
CREATE src/store/auth/model/auth.model.ts
CREATE src/store/dashboard/index.ts
CREATE src/store/dashboard/states/dictionary/dictionary.actions.ts
CREATE src/store/dashboard/states/dictionary/dictionary.state.ts
CREATE src/store/dashboard/states/dictionary/model/dictionary-response.model.ts
CREATE src/store/dashboard/states/user/user.actions.ts
CREATE src/store/dashboard/states/user/user.state.ts
CREATE src/store/dashboard/states/user/model/person.model.ts
Or with spec:
ng generate @ngxs/schematics:starter-kit --spec
Result:
CREATE src/store/store.config.ts
CREATE src/store/store.module.ts
CREATE src/store/auth/auth.actions.ts
CREATE src/store/auth/auth.state.spec.ts
CREATE src/store/auth/auth.state.ts
CREATE src/store/auth/model/auth.model.ts
CREATE src/store/dashboard/index.ts
CREATE src/store/dashboard/states/dictionary/dictionary.actions.ts
CREATE src/store/dashboard/states/dictionary/dictionary.state.spec.ts
CREATE src/store/dashboard/states/dictionary/dictionary.state.ts
CREATE src/store/dashboard/states/dictionary/model/dictionary-response.model.ts
CREATE src/store/dashboard/states/user/user.actions.ts
CREATE src/store/dashboard/states/user/user.state.spec.ts
CREATE src/store/dashboard/states/user/user.state.ts
CREATE src/store/dashboard/states/user/model/person.model.ts
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago