File

src/module/components/faq/mat-faq.component.ts

Metadata

selector mat-faq
styleUrls ./mat-faq.component.scss
templateUrl ./mat-faq.component.html

Index

Inputs

Inputs

displayMode

Default value : 'default'

faqList

Type : FaqItem[]

Default value : []

multi

Default value : false

title

Default value : 'FAQ'

import {Component, Input} from '@angular/core';
import {FaqItem} from '../../../module/faq.item';

@Component({
  selector: 'mat-faq',
  templateUrl: './mat-faq.component.html',
  styleUrls: ['./mat-faq.component.scss']
})
export class MatFaqComponent {

  @Input()
  title = 'FAQ';

  @Input()
  multi = false;

  @Input()
  displayMode = 'default'; // or flat

  @Input()
  faqList: FaqItem[] = [];

}
<mat-toolbar color="primary">{{title}}</mat-toolbar>
<mat-accordion [displayMode]="displayMode" [multi]="multi"
               class="faq-container">
  <mat-expansion-panel *ngFor="let faqItem of faqList">
    <mat-expansion-panel-header>{{faqItem.question}}</mat-expansion-panel-header>
    <p>{{faqItem.answer}}</p>
  </mat-expansion-panel>
</mat-accordion>

./mat-faq.component.scss

.faq-container {
  //width: 500px;
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""