oip-common 0.0.18 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,26 +1,66 @@
1
- # OipCommon
2
-
3
- Add assets in angular.json
4
- ```json
5
- {
6
- "glob": "**/*",
7
- "input": "node_modules/oip-common/assets",
8
- "output": "/assets"
9
- }
10
- ```
11
-
12
- Add tailwind config
13
-
14
- ```js
15
- const primeui = require('tailwindcss-primeui');
16
- module.exports = {
17
- /* Your config */
18
- content: [/* Your config */, './node_modules/oip-common/**/*.{html,ts,scss,css,js,mjs}'],
19
- /* Your config */
20
- };
21
- ```
22
-
23
- Add scss
24
- ```sass
25
- @use "../../../node_modules/oip-common/assets/oip-common";
26
- ```
1
+ # OipCommon
2
+
3
+ Add assets in angular.json
4
+
5
+ ```json
6
+ {
7
+ "glob": "**/*",
8
+ "input": "node_modules/oip-common/assets",
9
+ "output": "/assets"
10
+ }
11
+ ```
12
+
13
+ Add tailwind config
14
+
15
+ ```js
16
+ const primeui = require("tailwindcss-primeui");
17
+ module.exports = {
18
+ /* Your config */
19
+ content: [, /* Your config */ "./node_modules/oip-common/**/*.{html,ts,scss,css,js,mjs}"]
20
+ /* Your config */
21
+ };
22
+ ```
23
+
24
+ Add scss
25
+
26
+ ```sass
27
+ @use "../../../node_modules/oip-common/assets/oip-common";
28
+ ```
29
+
30
+ Init L10nService to AppComponent
31
+
32
+ ```ts
33
+ import { Component, inject, OnInit } from '@angular/core';
34
+ import { SecurityService } from 'oip-common';
35
+ import { RouterOutlet } from '@angular/router';
36
+ import { ToastModule } from 'primeng/toast';
37
+ import { L10nService } from '../../../oip-common/src/services/l10n.service';
38
+
39
+ @Component({
40
+ selector: 'app-root',
41
+ template: `
42
+ <p-toast/>
43
+ <router-outlet></router-outlet>
44
+ `,
45
+ standalone: true,
46
+ imports: [ToastModule, RouterOutlet]
47
+ })
48
+ export class AppComponent implements OnInit {
49
+ private readonly securityService = inject(SecurityService);
50
+ private readonly translateService = inject(L10nService);
51
+
52
+ ngOnInit() {
53
+ this.securityService.auth();
54
+ this.translateService.init([{
55
+ code: 'en',
56
+ name: "English",
57
+ icon: "flag flag-gb"
58
+ }, {
59
+ code: 'ru',
60
+ name: "Русский",
61
+ icon: "flag flag-ru"
62
+ }]);
63
+ }
64
+ }
65
+
66
+ ```