src/lib/wrapper/tags-widget/tags-widget.component.ts
selector | sb-tags-widget |
styleUrls | ./tags-widget.component.css |
templateUrl | ./tags-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
|
wrapperEventListener | ||||
wrapperEventListener(data)
|
||||
Inherited from
BaseWrapperComponent
|
||||
Defined in
BaseWrapperComponent:28
|
||||
Parameters :
Returns :
void
|
wrapperInit |
wrapperInit()
|
Inherited from
BaseWrapperComponent
|
Defined in
BaseWrapperComponent:24
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Inherited from
BaseWrapperComponent
|
Defined in
BaseWrapperComponent:21
|
Returns :
void
|
tagName |
Type : string
|
tags |
Type : string
|
Default value : CONSTANTS.TAGS
|
tagsAll |
Type : string
|
Default value : CONSTANTS.TAGSALL
|
state |
Type : string
|
Inherited from
BaseWrapperComponent
|
Defined in
BaseWrapperComponent:18
|
import { Component, 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 { BaseWrapperComponent } from '../base-wrapper/base-wrapper.component';
import * as CONSTANTS from '../../common/constants.json';
@Component({
selector: 'sb-tags-widget',
templateUrl: './tags-widget.component.html',
styleUrls: ['./tags-widget.component.css']
})
export class TagsWidgetComponent extends BaseWrapperComponent {
tags: string = CONSTANTS.TAGS
tagsAll: string = CONSTANTS.TAGSALL
tagName: string
constructor(configSvc: ConfigService, discussionService: DiscussionService, navigationServiceService: NavigationServiceService, eventService: EventsService) {
super(navigationServiceService, eventService, configSvc, discussionService)
}
wrapperInit() {
this.state = this.tags
}
wrapperEventListener(data) {
// if (data.action === this.tags || data.action === this.tagName) {
// this.state = data.action
// }
this.tagName = data.tagName
}
}
<div >
<lib-discuss-tags *ngIf='state === tags'></lib-discuss-tags>
<!-- <lib-tag-all-discussion *ngIf='state === tagsAll' [tagName]='tagName'></lib-tag-all-discussion> -->
<!-- <lib-discuss-home *ngIf='state === homePage'></lib-discuss-home>
<lib-discussion-details *ngIf='state === detailsPage' [topicId]='tid' [slug]='slug'></lib-discussion-details> -->
</div>
./tags-widget.component.css