Skip to content

Commit

Permalink
Merge pull request NationalBankBelgium#33 from christophercr/feature/…
Browse files Browse the repository at this point in the history
…compodoc-config-refactoring

docs(developer-guide): include developer guide in compodoc generated docs
  • Loading branch information
christophercr authored Nov 7, 2019
2 parents a9707d5 + a87bdb6 commit 2a37d3d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .compodocrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/@compodoc/compodoc/src/config/schema.json",
"theme": "material",
"tsconfig": "./tsconfig.json",
"output": "./reports/api-docs/ngx-form-errors",
"includes": "./docs",
"includesName": "Developer Guide"
}
12 changes: 6 additions & 6 deletions docs/DEV_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

---

## <a name="ngx-form-errors">ngxFormErrors directive
## <a name="ngx-form-errors"></a>ngxFormErrors directive

This directive creates an Error component dynamically where the validation messages will be displayed. See [Defining the Error component to use](#defining-error-component).

### <a name="binding-form-control">Binding to a FormControl
### <a name="binding-form-control"></a>Binding to a FormControl

Let's start by defining the Angular form group:

Expand Down Expand Up @@ -60,7 +60,7 @@ At runtime, the validation messages are displayed by the Error component that is

Remember that you need to provide the Error component that will be created by this directive. See [Defining the Error component to use](#defining-error-component).

### <a name="validation-errors">Validation errors emitted
### <a name="validation-errors"></a>Validation errors emitted

In order to display the validation messages in the Error component, the `ngxFormErrors` directive emits an array of error objects containing the following information:

Expand Down Expand Up @@ -198,7 +198,7 @@ Just wrap the `ngxFormErrors` directive inside a `<mat-error>` element and that'
</form>
```

In fact, we have integrated [Angular Material](https://material.angular.io) in our [demo app](../demo-app). Check it out!
In fact, we have integrated [Angular Material](https://material.angular.io) in our [demo app](https://github.com/NationalBankBelgium/ngx-form-errors/tree/master/demo-app). Check it out!

You can also integrate the directive with other UI libraries. This is really simple since you just need to use an `<ng-template>` element to use the `ngxFormErrors` directive so you can place it anywhere in the template according to your needs :wink:

Expand Down Expand Up @@ -385,7 +385,7 @@ formErrorsMessageService.addErrorMessages({
});
```

In fact, we have integrated [ngx-translate](https://github.com/ngx-translate/core) in our [demo app](../demo-app). Check it out!
In fact, we have integrated [ngx-translate](https://github.com/ngx-translate/core) in our [demo app](https://github.com/NationalBankBelgium/ngx-form-errors/tree/master/demo-app). Check it out!

The same functionality can be achieved with any other i18n library, you just need to integrate it in your Error component :wink:

Expand Down Expand Up @@ -466,7 +466,7 @@ getErrorMessages(): NgxValidationErrorMessages;
findErrorMessage(error: string, formControlName?: string, group?: string): string | undefined;
```

### <a name="adding-alias-globally-for-form-controls">Adding field names or alias globally
### <a name="adding-alias-globally-for-form-controls"></a>Adding field names or alias globally

Sometimes the names of the fields in your model (and therefore in your form) are not really descriptive for the end user,
in those cases you might want to display better error messages with meaningful field names.
Expand Down
6 changes: 6 additions & 0 deletions docs/summary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"title": "Developer Guide",
"file": "DEV_GUIDE.md"
}
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"docs": "npm run docs:clean && npm run docs:generate",
"docs:clean": "npx rimraf reports/api-docs",
"docs:coverage": "npm run docs:generate -- --coverageTest 85 --coverageTestThresholdFail true",
"docs:generate": "node ./node_modules/@compodoc/compodoc/bin/index-cli src --theme material --tsconfig ./tsconfig.json --output ./reports/api-docs/ngx-form-errors",
"docs:generate": "node ./node_modules/@compodoc/compodoc/bin/index-cli src",
"docs:serve": "npm run docs:generate -- --watch --serve --port 4321",
"docs:publish": "bash ./gh-deploy.sh --trace",
"generate:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
Expand Down

0 comments on commit 2a37d3d

Please sign in to comment.