File

src/app/shared/view-header/view-header.component.ts

Implements

OnInit

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector app-view-header
styleUrls view-header.component.scss
templateUrl ./view-header.component.html

Index

Methods
Inputs
Outputs

Constructor

constructor()

Inputs

viewList

Type: Array<string>

Outputs

viewChanged $event type: EventEmitter<string>

Methods

ngOnInit
ngOnInit()
Returns : void
import {
  ChangeDetectionStrategy,
  Component,
  EventEmitter,
  Input,
  OnInit,
  Output
} from '@angular/core';

@Component({
  selector: 'app-view-header',
  templateUrl: './view-header.component.html',
  styleUrls: ['./view-header.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ViewHeaderComponent implements OnInit {
  @Input()
  viewList: Array<string>;
  @Output()
  viewChanged: EventEmitter<string> = new EventEmitter();
  constructor() { }

  ngOnInit() {
  }

}
<md-tab-group>
  <md-tab *ngFor="let view of viewList">
    <ng-template md-tab-label>
      <div (click)="viewChanged.emit(view)">
        {{ view | capitals }}
      </div>
    </ng-template>
  </md-tab>
</md-tab-group>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""