@next-level-integration/list-errors
v10.0.8-beta
Published
list errors angular component
Downloads
49
Readme
Nli List Errors
This library display error messages in side navigation bar. It contain two components:
- header error - an icon with number of errors which will show in ui, user can click on it to open/close the sidenav bar.
<nli-header-error></ nli-header-error>
- list errors - a sidenav bar to show user a list of error message, with delete button.
<nli-list-errors></ nli-list-errors>
How to use
- This library contain its own data model, please double check the data model from server is same as
error.model.ts
- This library contain its own translation, which use ngx-translate. Translation json are located in
assets
folder.- after build this library make sure the assets folder also copy to the dist folder.
- after npm publish, please make sure the main project which will import this lib, able to support multiple translate http loader. Without support multi loader,
the translation for this library will not work, and it might clash to your main project translation
export function HttpLoaderFactory(http: HttpClient) { return new MultiHttpTranslateLoader(http, [ {prefix: "./assets/i18n/", suffix: ".json"}, {prefix: "./lib/list-errors/assets/i18n/", suffix: ".json"}, ]); }
- After npm install this lib in your main project, then add below configuration into
angular.json
assets path."assets": [ "src/assets", ...... ..... ... { "glob": "**/*", "input": "./node_modules/@next-level-integration/list-errors/assets", "output": "./lib/list-errors/assets/" } ],
- then the translation will work as expected in the list-errors components. Above point 1, 1st prefix map is actually refer to point 2 output folder.