File

src/lib/wrapper/category-widget/category-widget.component.ts

Extends

BaseWrapperComponent

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(configSvc: ConfigService, discussionService: DiscussionService, navigationServiceService: NavigationServiceService, eventService: EventsService)
Parameters :
Name Type Optional
configSvc ConfigService No
discussionService DiscussionService No
navigationServiceService NavigationServiceService No
eventService EventsService No

Inputs

config
Type : IdiscussionConfig
Inherited from BaseWrapperComponent

Methods

stateChange
stateChange(event)
Parameters :
Name Optional
event No
Returns : void
Protected wrapperEventListener
wrapperEventListener(data)
Inherited from BaseWrapperComponent
Parameters :
Name Optional
data No
Returns : void
wrapperInit
wrapperInit()
Inherited from BaseWrapperComponent
Returns : void
ngOnInit
ngOnInit()
Inherited from BaseWrapperComponent
Returns : void

Properties

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
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%;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""