@pykara/pykara-chat 0.0.1 → 0.0.2
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 +50 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,63 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @pykara/pykara-chat
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An Angular UI library (npm package) that provides a simple chat widget component.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
npm i @pykara/pykara-chat
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
---
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
ng generate --help
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Building
|
|
15
|
+
## What this package provides
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
### Component
|
|
18
|
+
- **Class name (import name):** `ChatWidget`
|
|
19
|
+
- **HTML selector (tag):** `<lib-chat-widget></lib-chat-widget>`
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
ng build pykara-chat
|
|
25
|
-
```
|
|
21
|
+
---
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
## Usage in Angular
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
## Option 1: Module-based Angular project (AppModule)
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
If your project has `app.module.ts`:
|
|
32
28
|
|
|
33
|
-
1
|
|
34
|
-
```bash
|
|
35
|
-
cd dist/pykara-chat
|
|
36
|
-
```
|
|
29
|
+
### 1) Import the component in `app.module.ts`
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```
|
|
31
|
+
```ts
|
|
32
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
33
|
+
import { NgModule } from '@angular/core';
|
|
42
34
|
|
|
43
|
-
|
|
35
|
+
import { AppRoutingModule } from './app-routing.module';
|
|
36
|
+
import { App } from './app';
|
|
44
37
|
|
|
45
|
-
|
|
38
|
+
import { ChatWidget } from '@pykara/pykara-chat';
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
@NgModule({
|
|
41
|
+
declarations: [App],
|
|
42
|
+
imports: [
|
|
43
|
+
BrowserModule,
|
|
44
|
+
AppRoutingModule,
|
|
45
|
+
ChatWidget
|
|
46
|
+
],
|
|
47
|
+
providers: [],
|
|
48
|
+
bootstrap: [App]
|
|
49
|
+
})
|
|
50
|
+
export class AppModule {}
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
### 2) Use it in HTML
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
Example: `src/app/app.html` or `app.component.html`
|
|
54
56
|
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
+
```html
|
|
58
|
+
<lib-chat-widget></lib-chat-widget>
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
---
|
|
60
62
|
|
|
61
|
-
##
|
|
63
|
+
## Option 2: Standalone Angular project (no AppModule)
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
```ts
|
|
66
|
+
import { Component } from '@angular/core';
|
|
67
|
+
import { ChatWidget } from '@pykara/pykara-chat';
|
|
68
|
+
|
|
69
|
+
@Component({
|
|
70
|
+
selector: 'app-root',
|
|
71
|
+
standalone: true,
|
|
72
|
+
imports: [ChatWidget],
|
|
73
|
+
template: `<lib-chat-widget></lib-chat-widget>`
|
|
74
|
+
})
|
|
75
|
+
export class App {}
|
|
76
|
+
```
|