https://github.com/jlguenego/schematics
Some schematics for Angular
https://github.com/jlguenego/schematics
angular angular-cli schematics
Last synced: 2 months ago
JSON representation
Some schematics for Angular
- Host: GitHub
- URL: https://github.com/jlguenego/schematics
- Owner: jlguenego
- Created: 2019-03-16T10:31:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-16T12:45:46.000Z (over 7 years ago)
- Last Synced: 2025-03-22T13:36:18.553Z (over 1 year ago)
- Topics: angular, angular-cli, schematics
- Language: TypeScript
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# What is it?
A collection of schematics that extends the default one.
I did it for making simpler my daily work with Angular.
Its only purpose is to improve DX.
# Getting Started
```
ng new my-project
cd my-project
npm i @jlguenego/schematics
```
Edit `angular.json`, and add
```
{
// rest of the file
"cli": {
"defaultCollection": "@jlguenego/schematics"
}
}
```
Done!
# Using schematics
Create a routing module `hello`.
```
ng g routing hello
```
Create a route `home`
```
ng g route hello/home ""
```
Create a page `success`
```
ng g page hello/success
```
# Schematics Reference
## routing
Create a routing module.
1. Create a module if it does not exist.
2. Create the associated routing module.
## route
1. Find the module A where to create the route.
2. Create the routing module B if not already present.
3. Create the route component and declare it in the module A.
4. Create the route with the path specified in the routing module B.
Example:
```
ng g route hello world
```
Create the HomeComponent in the AppModule.
Configure the route as:
```
const routes: Routes = [
// ...
{ path: "world", component: HelloComponent }
];
```
## page
1. Create a component with suffix `PageComponent`.
2. Declare it inside a module in `entryComponents` section.
Options are same as the @schematics/angular component.
# Author
Jean-Louis GUENEGO - 2019.