-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be95d8e
commit 8c73c91
Showing
7 changed files
with
234 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Add Route | ||
|
||
## 1.- Generate module with routing | ||
|
||
```bash | ||
ng generate module routes/home --routing --module=app.module | ||
``` | ||
|
||
## 2.- Generate page component | ||
|
||
```bash | ||
ng generate component routes/home/home --type=page --export=false --selector=false | ||
``` | ||
|
||
## 3.- Add route to feature module and app module | ||
|
||
```typescript | ||
// home-routing.module.ts | ||
const routes: Routes = [{ path: "", component: HomePage, title: "Home" }]; | ||
|
||
// app-routing.module.ts | ||
const routes: Routes = [ | ||
{ | ||
path: "", | ||
loadChildren: () => import("@app/home").then((module) => module.HomeModule), | ||
}, | ||
]; | ||
``` | ||
|
||
## 4.- Generate service | ||
|
||
```bash | ||
ng generate service routes/home | ||
``` | ||
|
||
## 5.- Generate presenter component | ||
|
||
```bash | ||
ng generate component routes/home/home --export=false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Config Schematics | ||
|
||
## Modify Angular.json | ||
|
||
### Components | ||
|
||
Use OnPush change detection strategy | ||
Delay style declaration until last moment | ||
Try to be flat | ||
Do not test at component level | ||
|
||
```json | ||
"schematics": { | ||
"@schematics/angular:component": { | ||
"changeDetection": "OnPush", | ||
"inlineStyle": true, | ||
"flat": true, | ||
"skipTests": true, | ||
"style": "none", | ||
} | ||
} | ||
``` | ||
|
||
### Services | ||
|
||
Do not test at service level | ||
|
||
```json | ||
"schematics": { | ||
"@schematics/angular:service": { | ||
"skipTests": true, | ||
"flat": true | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"root": true, | ||
"ignorePatterns": ["projects/**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@angular-eslint/recommended", | ||
"plugin:@angular-eslint/template/process-inline-templates", | ||
"plugin:prettier/recommended" | ||
], | ||
"rules": { | ||
"prettier/prettier": ["none"], | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"@angular-eslint/directive-selector": [ | ||
"error", | ||
{ | ||
"type": "attribute", | ||
"prefix": "lab", | ||
"style": "camelCase" | ||
} | ||
], | ||
"@angular-eslint/component-class-suffix": [ | ||
"error", | ||
{ | ||
"suffixes": ["Component", "Form", "Page", "Widget"] | ||
} | ||
], | ||
"@angular-eslint/component-selector": [ | ||
"error", | ||
{ | ||
"type": "element", | ||
"prefix": "lab", | ||
"style": "kebab-case" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.html"], | ||
"extends": [ | ||
"plugin:@angular-eslint/template/recommended", | ||
"plugin:@angular-eslint/template/accessibility" | ||
], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"bracketSameLine": true, | ||
"endOfLine": "auto", | ||
"printWidth": 100, | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all" | ||
} |