Add icon component
This commit is contained in:
4
src/components/popover/widgets/icon.component.scss
Normal file
4
src/components/popover/widgets/icon.component.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
:host {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
29
src/components/popover/widgets/icon.component.ts
Normal file
29
src/components/popover/widgets/icon.component.ts
Normal 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() { }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user