ngx-tencent-im
Version:
Instant messaging for Angular.
32 lines • 6.16 kB
JavaScript
import { Component } from '@angular/core';
import { currentConversationSelector } from '../../store/selectors';
import TIM from 'tim-js-sdk';
import * as i0 from "@angular/core";
import * as i1 from "@ngrx/store";
import * as i2 from "./conversation-profile/user-profile/user-profile.component";
import * as i3 from "./conversation-profile/group-profile/group-profile.component";
import * as i4 from "@angular/common";
export class ConversationProfileComponent {
constructor(store) {
this.store = store;
this.TIM = TIM;
}
ngOnInit() {
this.subscription = this.store.select(currentConversationSelector)
.subscribe(res => {
this.currentConversation = res;
});
}
ngOnDestroy() {
if (this.subscription) {
this.subscription.unsubscribe();
}
}
}
ConversationProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ConversationProfileComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component });
ConversationProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: ConversationProfileComponent, selector: "app-conversation-profile", ngImport: i0, template: "<div class=\"conversation-profile-wrapper\">\r\n <app-user-profile *ngIf=\"currentConversation.type === TIM.TYPES.CONV_C2C\"\r\n [userProfile]=\"currentConversation.userProfile\"></app-user-profile>\r\n\r\n <app-group-profile *ngIf=\"currentConversation.type === TIM.TYPES.CONV_GROUP\"\r\n [currentConversation]=\"currentConversation\"></app-group-profile>\r\n</div>\r\n", styles: [".conversation-profile-wrapper{background-color:#fff;height:100%;overflow-y:scroll}::-webkit-scrollbar{width:0px;height:0px}\n"], components: [{ type: i2.UserProfileComponent, selector: "app-user-profile", inputs: ["userProfile"] }, { type: i3.GroupProfileComponent, selector: "app-group-profile", inputs: ["currentConversation"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ConversationProfileComponent, decorators: [{
type: Component,
args: [{ selector: 'app-conversation-profile', template: "<div class=\"conversation-profile-wrapper\">\r\n <app-user-profile *ngIf=\"currentConversation.type === TIM.TYPES.CONV_C2C\"\r\n [userProfile]=\"currentConversation.userProfile\"></app-user-profile>\r\n\r\n <app-group-profile *ngIf=\"currentConversation.type === TIM.TYPES.CONV_GROUP\"\r\n [currentConversation]=\"currentConversation\"></app-group-profile>\r\n</div>\r\n", styles: [".conversation-profile-wrapper{background-color:#fff;height:100%;overflow-y:scroll}::-webkit-scrollbar{width:0px;height:0px}\n"] }]
}], ctorParameters: function () { return [{ type: i1.Store }]; } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVyc2F0aW9uLXByb2ZpbGUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXRlbmNlbnQtaW0vc3JjL2NvbnZlcnNhdGlvbi9jb252ZXJzYXRpb24tcHJvZmlsZS9jb252ZXJzYXRpb24tcHJvZmlsZS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdGVuY2VudC1pbS9zcmMvY29udmVyc2F0aW9uL2NvbnZlcnNhdGlvbi1wcm9maWxlL2NvbnZlcnNhdGlvbi1wcm9maWxlLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQXFCLE1BQU0sZUFBZSxDQUFDO0FBSTdELE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3BFLE9BQU8sR0FBRyxNQUFNLFlBQVksQ0FBQzs7Ozs7O0FBTzdCLE1BQU0sT0FBTyw0QkFBNEI7SUFLdkMsWUFDVSxLQUFZO1FBQVosVUFBSyxHQUFMLEtBQUssQ0FBTztRQUx0QixRQUFHLEdBQUcsR0FB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