File

src/lib/directives/justify.directive.ts

Metadata

selector [justify]

Inputs

justify

Type: "start" | "end" | "center" | "between" | "around"

Default value: between

Properties

around
around: boolean
between
between: boolean
center
center: boolean
end
end: boolean
flex
flex: boolean
Default value: true
flex2
flex2: boolean
Default value: true
start
start: boolean
import { Directive, Input, HostBinding } from '@angular/core';

@Directive({
    // tslint:disable-next-line:directive-selector
    selector: '[justify]'
})
export class JustifyDirective {
    @Input() justify: 'start' | 'end' | 'center' | 'between' | 'around' = 'between';

    @HostBinding('class.d-flex') flex = true;
    @HostBinding('class.align-items-center') flex2 = true;

    @HostBinding('class.justify-content-start') get start() {
        return this.justify === 'start';
    }

    @HostBinding('class.justify-content-end') get end() {
        return this.justify === 'end';
    }

    @HostBinding('class.justify-content-center') get center() {
        return this.justify === 'center';
    }

    @HostBinding('class.justify-content-between') get between() {
        return !this.justify || this.justify === 'between';
    }

    @HostBinding('class.justify-content-around') get around() {
        return this.justify === 'around';
    }

}

results matching ""

    No results matching ""