File

src/lib/wrapper/base-wrapper/base-wrapper.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs

Constructor

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

Inputs

config
Type : IdiscussionConfig

Methods

ngOnInit
ngOnInit()
Returns : void
Protected wrapperEventListener
wrapperEventListener(data)
Parameters :
Name Optional
data No
Returns : void
Protected wrapperInit
wrapperInit()
Returns : void

Properties

state
Type : string
import { Component, Input, OnInit } from '@angular/core';
import { EventsService } from '../../events.service';
import { NavigationServiceService } from '../../navigation-service.service';
import { ConfigService } from '../../services/config.service';
import { DiscussionService } from '../../services/discussion.service';
import * as _ from 'lodash'
import { IdiscussionConfig } from '../../models/discussion-config.model';

@Component({
  selector: 'sb-base-wrapper',
  templateUrl: './base-wrapper.component.html',
  styleUrls: ['./base-wrapper.component.css'],
  providers: [NavigationServiceService, EventsService]
})
export class BaseWrapperComponent implements OnInit {

  @Input() config: IdiscussionConfig
  state: string
  constructor(private navigationServiceService: NavigationServiceService, private eventService: EventsService, private configSvc: ConfigService, private discussionService: DiscussionService) { }

  ngOnInit() {
    this.navigationServiceService.initService('wrapperService')
    this.configSvc.setConfigFromWidgetBaseClass(this.config)
    this.discussionService.userId = _.get(this.config, 'userName')
    const rawCategories = _.get(this.config, 'categories')
    this.discussionService.forumIds = _.get(rawCategories, 'result')
    this.discussionService.initializeUserDetails(this.config.userName)

    this.eventService.toggleMenuItem.subscribe((data) => {
      this.wrapperEventListener(data)
      this.state = data.action
    
    })
    this.wrapperInit()
  }

  protected wrapperInit() { }

  protected wrapperEventListener(data) { }

}
<p>base-wrapper works!</p>

./base-wrapper.component.css

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""