# KstChat

chat component for rocket.chat

# 依赖说明
 
* bootstrap4的样式文件

# 安装说明


* 1.x 针对angular7.x
* 2.x 针对angular6.x

# 安装

1. npm install kst-chat || yarn add kst-chat
2. 入口module 里面 导入模块`StoreModule`，如果本身你的应用使用了ngrx,请忽略
3. 入口module导入模块
    ```javascript
    KstChatModule.forRoot({
      url: 'http://192.168.31.137:8818',
      register: {
        secretURL: '4PjnyEkwb4zP3JaNo'
      },
      websocket: {
        url: 'ws://192.168.31.137:8818/websocket'
      },
      file: {
        uploadUrl: 'http://oss.kingsmartech.com/api/kstfile/files/upload',
        getFileUrl: `http://oss.kingsmartech.com/api/kstfile/files/www/{fileid}`
      }
    })
    ```
4. angular.json中 styles节点加入`"node_modules/kst-chat/src/styles.less"`
5. 使用
    ``` html

     <kst-chat [user]="currentUser" channel="test1"></kst-chat>

    ```
    
    ``` javascript
    currentUser: any = {
        appUserName: '张三',
        username: 'zhangsan',
        userId: 23,
        chatpwd: '123456'
    };

    ```