Instant messaging for Angular.
npm install ngx-tencent-im
Tencent instant messaging for Angular
bash
npm install ngx-tencent-im --save
`
Add package to NgModule imports:
`ts
import { TencentTimModule } from 'ngx-tencent-im';
@NgModule({
...
TencentTimModule.forRoot({
level: 4,
sdkAppId: xxxxxxx, // <--- your im app id
oversea: true // <--- support oversea
}),
...
})
`
Add component to your page:
`html
`
You will need to add css in angular.json:
- angular.json
`json
"assets": [
...
{
"glob": "*/",
"input": "./node_modules/@ant-design/icons-angular/src/inline-svg/",
"output": "/assets/"
}
],
"styles": [
...
"node_modules/ng-zorro-antd/ng-zorro-antd.min.css",
"node_modules/ngx-tencent-im/assets/icon/iconfont.css",
"node_modules/ngx-tencent-im/assets/icon/tim.css"
],
`
$3
First time:
`bash
git clone https://github.com/enochgao/ngx-tencent-im.git
cd ngx-tencent-im
npm install
ng build ngx-tencent-im
npm start
``