System-messages
This library allow user to receive notification from system-messages server, where user just need to provide the request url to component. It contain two components:
- system-messages-display - a sidenav bar to show user a list of messages, with mark as read buttons.
- system-message-display-icon - an icon which will show in ui for user to open the sidenav bar.
How to use
- Both component need to provide the same parameter
systemMessageProxyUrl
, this parameter is to tell the component where to call to get systems messages from the server / backend. - This library contain its own data model, please double check the data model from server is same as
system-messages.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
- E.g.
export function HttpLoaderFactory(http: HttpClient) { return new MultiHttpLoader(http, [ {prefix: "./lib/system-messages/assets/i18n/", suffix: ".json"}, {prefix: "./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/system-messages/assets", "output": "./lib/system-messages/assets/" } ],
- then the translation will work as expected in the system-messages components. Above point 1, 1st prefix map is actually refer to point 2 output folder.
- E.g.