src/lib/wrapper/category-widget/category-widget.component.ts
selector | sb-category-widget |
styleUrls | ./category-widget.component.css |
templateUrl | ./category-widget.component.html |
Properties |
Methods |
|
Inputs |
constructor(configSvc: ConfigService, discussionService: DiscussionService, navigationServiceService: NavigationServiceService, eventService: EventsService)
|
|||||||||||||||
Parameters :
|
config | |
Type : IdiscussionConfig
|
|
Inherited from
BaseWrapperComponent
|
|
Defined in
BaseWrapperComponent:17
|
stateChange | ||||
stateChange(event)
|
||||
Parameters :
Returns :
void
|
Protected wrapperEventListener | ||||
wrapperEventListener(data)
|
||||
Inherited from
BaseWrapperComponent
|
||||
Defined in
BaseWrapperComponent:42
|
||||
Parameters :
Returns :
void
|
wrapperInit |
wrapperInit()
|
Inherited from
BaseWrapperComponent
|
Defined in
BaseWrapperComponent:30
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Inherited from
BaseWrapperComponent
|
Defined in
BaseWrapperComponent:21
|
Returns :
void
|
category |
Default value : CONSTANTS.CATEGORY
|
context |
Type : IdiscussionConfig
|
detailsPage |
Default value : CONSTANTS.CATEGORY_DETAILS
|
detailsToggle |
Default value : true
|
homePage |
Default value : CONSTANTS.CATEGORY_HOME
|
slug |
Type : string
|
tid |
Type : number
|
state |
Type : string
|
Inherited from
BaseWrapperComponent
|
Defined in
BaseWrapperComponent:18
|
import { Component, Input, OnInit } from '@angular/core';
import { ConfigService } from '../../services/config.service';
import { DiscussionService } from '../../services/discussion.service';
import * as _ from 'lodash'
import { NavigationServiceService } from '../../navigation-service.service';
import * as CONSTANTS from '../../common/constants.json';
import { EventsService } from '../../events.service';
import { BaseWrapperComponent } from '../base-wrapper/base-wrapper.component';
import { IdiscussionConfig } from '../../models/discussion-config.model';
@Component({
selector: 'sb-category-widget',
templateUrl: './category-widget.component.html',
styleUrls: ['./category-widget.component.css']
})
export class CategoryWidgetComponent extends BaseWrapperComponent {
detailsToggle = true;
category = CONSTANTS.CATEGORY;
detailsPage = CONSTANTS.CATEGORY_DETAILS
homePage = CONSTANTS.CATEGORY_HOME
tid: number
slug: string
context: IdiscussionConfig
constructor(configSvc: ConfigService, discussionService: DiscussionService, navigationServiceService: NavigationServiceService, eventService: EventsService) {
super(navigationServiceService, eventService, configSvc, discussionService)
}
wrapperInit() {
this.state = this.detailsPage;
}
stateChange(event) {
this.state = event.action
if (event.action === this.detailsPage) {
this.tid = event.tid
this.slug = event.title
}
}
protected wrapperEventListener(data) {
}
}
<div class='widget-container'>
<!-- <lib-discuss-category *ngIf='state === category ' [categoryAction]='homePage' (stateChange)='stateChange($event)'></lib-discuss-category>
<lib-discuss-home *ngIf='state === homePage' [categoryHomeAction]='detailsPage' (stateChange)='stateChange($event)'></lib-discuss-home> -->
<!-- <lib-discussion-details *ngIf='state === detailsPage' [widget]="true" [topicId]='tid' [slug]='slug'></lib-discussion-details> -->
<lib-discuss-all [context]='context'></lib-discuss-all>
</div>
./category-widget.component.css
.widget-container {
display: flex;
width: 100%;
}