Skip to content

Commit 164b365

Browse files
Integrated latest changes at 12-11-2024 1:30:19 AM
1 parent f6a5f4f commit 164b365

File tree

85 files changed

+1579
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1579
-42
lines changed

ej2-angular-toc.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,11 @@
551551
<li><a href="https://ej2.syncfusion.com/angular/documentation/api/chart/">API Reference</a></li>
552552
</ul>
553553
</li><li>
554+
Chat UI
555+
<ul>
556+
<li><a href="/ej2-angular/chat-ui/getting-started">Getting Started</a></li>
557+
</ul>
558+
</li><li>
554559
CheckBox
555560
<ul>
556561
<li><a href="/ej2-angular/check-box/getting-started">Getting Started</a></li>
@@ -1984,11 +1989,12 @@
19841989
<li><a href="/ej2-angular/pdfviewer/how-to/restricting-zoom-in-mobile-mode">Restrict Zoom Percentage on Mobile Devices</a></li>
19851990
<li><a href="/ej2-angular/pdfviewer/how-to/custom-font-signature-field">Custom fonts for Signature and Initial fields</a></li>
19861991
<li><a href="/ej2-angular/pdfviewer/how-to/export-as-image">Export As Image in Angular PDF Viewer component</a></li>
1987-
<li><a href="/ej2-angular/pdfviewer/how-to/custom-fonts">Customize context menu in Angular Pdfviewer component</a></li>
1992+
<li><a href="/ej2-angular/pdfviewer/how-to/custom-fonts">Add custom fonts to the PDF Viewer using the PDF document</a></li>
19881993
<li><a href="/ej2-angular/pdfviewer/how-to/create-a-standalone-pdf-viewer-in-angular-17-and-above-with-no-standalone-flag">Create a Standalone PDF Viewer in Angular 17 and above with --no-standalone flag</a></li>
19891994
<li><a href="/ej2-angular/pdfviewer/how-to/create-a-standalone-pdf-viewer-in-angular-17-and-above-without-no-standalone-flag">Create a Standalone PDF Viewer in Angular 17 and above without --no-standalone flag</a></li>
19901995
<li><a href="/ej2-angular/pdfviewer/how-to/configure-annotation-selector-setting">Configure Annotation Selector Setting</a></li>
19911996
<li><a href="/ej2-angular/pdfviewer/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds">Convert Pdf Library Bounds to Pdf viewer bounds</a></li>
1997+
<li><a href="/ej2-angular/pdfviewer/how-to/show-custom-stamp-item">Display Custom Stamp items in Custom Stamp</a></li>
19921998
</ul>
19931999
</li>
19942000
<li>Troubleshooting
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
---
2+
layout: post
3+
title: Getting started with Angular Chat UI | Syncfusion
4+
description: Checkout and learn about Getting started with Angular Chat UI component of Syncfusion Essential JS 2 and more details.
5+
platform: ej2-angular
6+
control: Chat UI
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Getting started in Angular Chat UI component
12+
13+
This section explains how to create a simple **Chat UI** component and configure its available functionalities in Angular.
14+
15+
## Dependencies
16+
17+
The following list of dependencies are required to use the Angular Chat UI component in your application.
18+
19+
```javascript
20+
|-- @syncfusion/ej2-angular-interactive-chat
21+
|-- @syncfusion/ej2-angular-base
22+
|-- @syncfusion/ej2-base
23+
|-- @syncfusion/ej2-navigations
24+
|-- @syncfusion/ej2-inputs
25+
|-- @syncfusion/ej2-popups
26+
|-- @syncfusion/ej2-buttons
27+
```
28+
29+
## Setup angular environment
30+
31+
Angular provides the easiest way to set angular CLI projects using [`Angular CLI`](https://github.com/angular/angular-cli) tool.
32+
33+
Install the CLI application globally to your machine.
34+
35+
```bash
36+
npm install -g @angular/cli
37+
```
38+
39+
## Create a new application
40+
41+
```bash
42+
ng new syncfusion-angular-chat-ui
43+
```
44+
45+
By default, it install the CSS style base application. To setup with SCSS, pass --style=scss argument on create project.
46+
47+
Example code snippet.
48+
49+
```bash
50+
ng new syncfusion-angular-chat-ui --style=scss
51+
```
52+
53+
Navigate to the created project folder.
54+
55+
```bash
56+
cd syncfusion-angular-chat-ui
57+
```
58+
59+
## Installing Syncfusion Chat UI package
60+
61+
Syncfusion packages are distributed in npm as `@syncfusion` scoped packages. You can get all the Angular Syncfusion package from npm [link]( https://www.npmjs.com/search?q=%40syncfusion%2Fej2-angular- ).
62+
63+
Currently, Syncfusion provides two types of package structures for Angular components,
64+
1. Ivy library distribution package [format](https://v17.angular.io/guide/angular-package-format)
65+
2. Angular compatibility compiler(Angular’s legacy compilation and rendering pipeline) package.
66+
67+
### Ivy library distribution package
68+
69+
Syncfusion Angular packages(`>=20.2.36`) has been moved to the Ivy distribution to support the Angular [Ivy](https://docs.angular.lat/guide/ivy) rendering engine and the package are compatible with Angular version 12 and above. To download the package use the below command.
70+
71+
Add `@syncfusion/ej2-angular-interactive-chat` package to the application.
72+
73+
```bash
74+
npm install @syncfusion/ej2-angular-interactive-chat --save
75+
```
76+
77+
### Angular compatibility compiled package(ngcc)
78+
79+
For Angular version below 12, you can use the legacy (ngcc) package of the Syncfusion Angular components. To download the `ngcc` package use the below.
80+
81+
Add `@syncfusion/ej2-angular-interactive-chat@ngcc` package to the application.
82+
83+
```bash
84+
npm install @syncfusion/ej2-angular-interactive-chat@ngcc --save
85+
```
86+
87+
To mention the ngcc package in the `package.json` file, add the suffix `-ngcc` with the package version as below.
88+
89+
```bash
90+
@syncfusion/ej2-angular-interactive-chat:"27.1.48-ngcc"
91+
```
92+
93+
>Note: If the ngcc tag is not specified while installing the package, the Ivy Library Package will be installed and this package will throw a warning.
94+
95+
## Registering Chat UI module
96+
97+
Import Chat UI module into Angular application(app.module.ts) from the package `@syncfusion/ej2-angular-interactive-chat`.
98+
99+
```javascript
100+
import { NgModule } from '@angular/core';
101+
import { BrowserModule } from '@angular/platform-browser';
102+
// import the ChatUIModule for the Chat UI component
103+
import { ChatUIModule } from '@syncfusion/ej2-angular-interactive-chat';
104+
import { AppComponent } from './app.component';
105+
106+
@NgModule({
107+
//declaration of ej2-angular-interactive-chat module into NgModule
108+
imports: [ BrowserModule, ChatUIModule ],
109+
declarations: [ AppComponent ],
110+
bootstrap: [ AppComponent ]
111+
})
112+
export class AppModule { }
113+
```
114+
115+
## Adding CSS reference
116+
117+
The following CSS files are available in `../node_modules/@syncfusion` package folder.
118+
This can be referenced in [src/styles.css] using following code.
119+
120+
```css
121+
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
122+
@import '../node_modules/@syncfusion/ej2-interactive-chat/styles/material.css';
123+
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
124+
@import '../node_modules/@syncfusion/ej2-navigations/styles/material.css';
125+
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
126+
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
127+
```
128+
129+
## Adding Chat UI component
130+
131+
Modify the template in [src/app/app.component.ts] file to render the Angular Chat UI component. Add the Angular Chat UI by using `<ejs-chatui>` selector in `template` section of the app.component.ts file.
132+
133+
```javascript
134+
import { Component } from '@angular/core';
135+
import { ChatUIComponent } from '@syncfusion/ej2-angular-interactive-chat';
136+
137+
@Component({
138+
selector: 'app-root',
139+
// specifies the template string for the Chat UI component
140+
template: `<div ejs-chatui id='chatUI'></div>`
141+
})
142+
export class AppComponent { }
143+
```
144+
145+
## Run the application
146+
147+
After completing the configuration required to render a basic Chat UI, run the following command to display the output in your default browser.
148+
149+
```
150+
ng serve
151+
```
152+
153+
The following example illustrates the output in your browser.
154+
155+
{% tabs %}
156+
{% highlight ts tabtitle="app.component.ts" %}
157+
{% include code-snippet/chat-ui/getting-started/src/app.component.ts %}
158+
{% endhighlight %}
159+
160+
{% highlight ts tabtitle="main.ts" %}
161+
{% include code-snippet/chat-ui/getting-started/src/main.ts %}
162+
{% endhighlight %}
163+
{% endtabs %}
164+
165+
{% previewsample "page.domainurl/samples/chat-ui/getting-started" %}
166+
167+
## Configure messages and user
168+
169+
You can use the `messages` property to add messages and the `user` property to configure the current user for the chat.
170+
171+
{% tabs %}
172+
{% highlight ts tabtitle="app.component.ts" %}
173+
{% include code-snippet/chat-ui/defaultmessages/src/app.component.ts %}
174+
{% endhighlight %}
175+
176+
{% highlight ts tabtitle="main.ts" %}
177+
{% include code-snippet/chat-ui/defaultmessages/src/main.ts %}
178+
{% endhighlight %}
179+
{% endtabs %}
180+
181+
{% previewsample "page.domainurl/samples/chat-ui/defaultmessages" %}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"syncfusion-component": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist",
17+
"index": "index.html",
18+
"main": "src/main.ts",
19+
"tsConfig": "tsconfig.json",
20+
"styles": [
21+
"src/styles.css"
22+
],
23+
"assets": [
24+
{
25+
"glob": "*.css",
26+
"input": "",
27+
"output": ""
28+
}
29+
]
30+
},
31+
"configurations": {
32+
"production": {
33+
"budgets": [
34+
{
35+
"type": "initial",
36+
"maximumWarning": "500kb",
37+
"maximumError": "10mb"
38+
},
39+
{
40+
"type": "anyComponentStyle",
41+
"maximumWarning": "2kb",
42+
"maximumError": "4kb"
43+
}
44+
],
45+
"outputHashing": "all"
46+
},
47+
"development": {
48+
"buildOptimizer": false,
49+
"optimization": false,
50+
"vendorChunk": true,
51+
"extractLicenses": false,
52+
"sourceMap": true,
53+
"namedChunks": true
54+
}
55+
},
56+
"defaultConfiguration": "production"
57+
},
58+
"serve": {
59+
"builder": "@angular-devkit/build-angular:dev-server",
60+
"configurations": {
61+
"production": {
62+
"buildTarget": "syncfusion-component:build:production"
63+
},
64+
"development": {
65+
"buildTarget": "syncfusion-component:build:development"
66+
}
67+
},
68+
"defaultConfiguration": "development"
69+
}
70+
}
71+
}
72+
},
73+
"cli": {
74+
"analytics": false
75+
}
76+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
#loader {
3+
color: #008cff;
4+
height: 40px;
5+
width: 30%;
6+
position: absolute;
7+
top: 45%;
8+
left: 45%;
9+
}
10+
11+
#wrapper {
12+
height: 350px;
13+
width: 400px;
14+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Angular Chat UI</title>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta name="description" content="Angular Interactive Chat components" />
8+
9+
<meta name="author" content="Syncfusion" />
10+
<link href="index.css" rel="stylesheet" />
11+
<!-- Here we have used CDN links for our preview purpose -->
12+
</head>
13+
<body>
14+
<div id="wrapper">
15+
<app-root>
16+
<div id='loader'>LOADING....</div>
17+
</app-root>
18+
</div>
19+
</body>
20+
</html>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "syncfusion-component",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"watch": "ng build --watch --configuration development",
9+
"test": "ng test"
10+
},
11+
"private": true,
12+
"dependencies": {
13+
"@angular/core": "17.1.2",
14+
"@angular/forms": "17.1.2",
15+
"@angular/platform-browser": "17.1.2",
16+
"@angular/platform-browser-dynamic": "17.1.2",
17+
"@syncfusion/ej2-angular-interactive-chat": "*",
18+
"@syncfusion/ej2-angular-inputs": "*",
19+
"@syncfusion/ej2-angular-navigations": "*",
20+
"@syncfusion/ej2-angular-popups": "*",
21+
"@syncfusion/ej2-angular-buttons": "*",
22+
"@angular/animations": "17.1.2",
23+
"@angular/common": "17.1.2",
24+
"@angular/compiler": "17.1.2",
25+
"@angular/router": "17.1.2",
26+
"moment": "2.29.4",
27+
"rxjs": "7.8.0",
28+
"tslib": "2.3.0",
29+
"zone.js": "0.14.3"
30+
},
31+
"devDependencies": {
32+
"@angular-devkit/build-angular": "17.1.2",
33+
"@angular/cli": "17.1.2",
34+
"@angular/compiler-cli": "17.1.2",
35+
"@types/jasmine": "4.3.0",
36+
"jasmine-core": "4.5.0",
37+
"karma": "6.4.0",
38+
"karma-chrome-launcher": "3.1.0",
39+
"karma-coverage": "2.2.0",
40+
"karma-jasmine": "5.1.0",
41+
"karma-jasmine-html-reporter": "2.0.0",
42+
"typescript": "5.3.3"
43+
}
44+
}

0 commit comments

Comments
 (0)