File

my-lib/icon/icon.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
encapsulation ViewEncapsulation.None
selector icon
styleUrls icon.less,
patch.less
templateUrl ./icon.html

Index

Properties
Inputs
Accessors

Constructor

constructor(icon: IconStore)
Parameters :
Name Type Optional Description
icon IconStore

Inputs

loading

Type: any

name

Type: string

size
src

Type: string

type

Type: string

Properties

_classObj
_classObj: Object
Type : Object
Default value : { [`am-icon`]: true }
Public icon
icon: IconStore
Type : IconStore

Accessors

name
setname(val: string)
src
setsrc(val: string)
size
setsize(val: )
loading
setloading(val: any)
import {
    ViewEncapsulation, Component,
    Input, HostBinding, OnInit,
    InjectionToken, Inject, ChangeDetectionStrategy
} from '@angular/core';
import { setClassObj, isMeepoTrue } from 'meepo-utils';
import { HttpClient } from '@angular/common/http';
import { IconStore } from './icon.service';

@Component({
    selector: 'icon',
    templateUrl: './icon.html',
    styleUrls: ['./icon.less', './patch.less'],
    encapsulation: ViewEncapsulation.None,
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class IconComponent {
    _classObj: Object = { [`am-icon`]: true };
    @Input() type: string;
    @Input()
    set name(val: string) {
        this.type = val;
    }
    @Input()
    set src(val: string) {
        this.type = val;
    }

    @Input()
    set size(val: 'xss' | 'xs' | 'sm' | 'md' | 'lg') {
        this._classObj = setClassObj('xss,xs,sm,md,lg', this._classObj, val, 'am-icon');
    }
    @Input()
    set loading(val: any) {
        this._classObj['am-icon-loading'] = isMeepoTrue(val);
    }

    constructor(
        public icon: IconStore
    ) { }
}
<svg [ngClass]="_classObj">
    <use [attr.xlinkHref]="'#'+type" [attr.href]="'#'+type" />
</svg>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""