bia-framework
Version:
Bia Framework to work with angular 2
51 lines (38 loc) • 1.18 kB
text/typescript
import {OnInit, ElementRef, Input, Component, ViewEncapsulation} from "@angular/core";
import {NgClass} from "@angular/common";
/**
* Created by jd on 24/02/2016.
*/
export class CoreIcon implements OnInit
{
source:string;
size:string;
color:string;
templateString:string;
iClass:string;
selectable:boolean;
constructor(private element:ElementRef)
{
}
ngOnInit():any
{
var selectableClass = this.selectable==true ? " selectable " : "";
this.iClass = "icon--color-" + this.color + " icon-size-" + this.size + selectableClass ;
this.source = this.source || "adb";
this.templateString = "img/icons/" + this.source + ".svg#" + this.source;
return undefined;
}
}