-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Add instructions for using ng add #1770
Docs: Add instructions for using ng add #1770
Conversation
Preview docs changes for 40f597a at https://previews.ngrx.io/pr1770-40f597a/ |
Preview docs changes for 08c2463 at https://previews.ngrx.io/pr1770-08c2463/ |
@@ -15,3 +15,29 @@ For more information on using `yarn` check out the docs <a href="https://yarnpkg | |||
```sh | |||
yarn add @ngrx/schematics --dev | |||
``` | |||
|
|||
## Make @ngrx/scematics as default for app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Make @ngrx/scematics as default for app | |
## Installing with `ng add` |
|
||
## Make @ngrx/scematics as default for app | ||
|
||
You can also make @ngrx/schematics as default for your app. Run below command inside an angular application from the root. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also make @ngrx/schematics as default for your app. Run below command inside an angular application from the root. | |
You can also make `@ngrx/schematics` the default collection for your application. Run the below command inside your Angular application from within the root. |
|
||
`Do you want to use @ngrx/schematics as the default collection?(y/n)` | ||
|
||
Once you select `yes` you can notice below line added to `package.json`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you select `yes` you can notice below line added to `package.json`. | |
Once you select `yes` it will change the `defaultCollection` inside `angular.json`. |
|
||
Once you select `yes` you can notice below line added to `package.json`. | ||
|
||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
` | |
```json |
` | ||
"cli": { | ||
"defaultCollection": "@ngrx/schematics" | ||
}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}` | |
} |
"defaultCollection": "@ngrx/schematics" | ||
}` | ||
|
||
After this change you, are free to use any ngrx schematics without mentioning it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this change you, are free to use any ngrx schematics without mentioning it | |
After this change you're able to use the NgRx schematics without the need to suffix the command, for example: |
|
||
After this change you, are free to use any ngrx schematics without mentioning it | ||
|
||
`ng g store State` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`ng g store State` | |
```bash | |
ng generate store State |
|
||
`ng g store State` | ||
|
||
the above command will create, a reducer file for us. you will notice a new file in `app/reducers`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this line, as this isn't part of this schematic.
Thanks Tim , will update the PR. |
Preview docs changes for 24705ff at https://previews.ngrx.io/pr1770-24705ff/ |
Done with changes @timdeschryver you can review now. |
This install page needs to be more consistent with the other pages. See https://ngrx.io/guide/store/install for an example |
Coo, will make the change |
changes done @brandonroberts |
Preview docs changes for d181120 at https://previews.ngrx.io/pr1770-d181120/ |
Fixes #1739
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #1739
What is the new behavior?
Does this PR introduce a breaking change?
Other information