Add icon component

This commit is contained in:
József Farkas
2016-06-04 17:19:00 +02:00
parent f785734bc7
commit 4ea1d766b4
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
:host {
display: flex;
align-items: center;
}

View File

@@ -0,0 +1,29 @@
import { Component, OnInit, Input } from '@angular/core';
import { NgSwitch, NgSwitchWhen } from '@angular/common';
@Component({
moduleId: module.id,
selector: 'icon',
template:
`
<div [ngSwitch]="name">
<span *ngSwitchWhen="'option-vertical'" class="glyphicon glyphicon-option-vertical" aria-hidden="true"></span>
<i *ngSwitchWhen="'square'" class="fa fa-square"></i>
<i *ngSwitchWhen="'mouse-pointer'" class="fa fa-mouse-pointer"></i>
<i *ngSwitchWhen="'clock'" class="fa fa-clock-o"></i>
<i *ngSwitchWhen="'trash'" class="glyphicon glyphicon-trash action--trash"></i>
<i *ngSwitchWhen="'pencil'" class="glyphicon glyphicon-pencil action--edit"></i>
</div>
`,
directives: [NgSwitch, NgSwitchWhen],
styles: [require('./icon.component.scss')]
})
export class IconComponent implements OnInit {
@Input() name: string;
constructor() { }
ngOnInit() { }
}