File

projects/rebirth-ng/src/lib/progress-bar/progress-bar.component.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector re-progress-bar
styleUrls progress-bar.component.scss
templateUrl ./progress-bar.component.html

Index

Inputs

Constructor

constructor(rebirthNGConfig: RebirthNGConfig)
Parameters :
Name Type Optional
rebirthNGConfig RebirthNGConfig no

Inputs

animate

Type: boolean

cssClass

Type: string

max

Type: number

striped

Type: boolean

text

Type: string

thin

Type: boolean

type

Type: "" | "success" | "info" | "warning" | "danger"

Default value: ''

value

Type: number

import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
import { RebirthNGConfig } from '../rebirth-ng.config';

@Component({
  selector: 're-progress-bar',
  templateUrl: './progress-bar.component.html',
  styleUrls: ['./progress-bar.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ProgressBarComponent {
  @Input() type: '' | 'success' | 'info' | 'warning' | 'danger' = '';
  @Input() text: string;
  @Input() thin: boolean;
  @Input() max: number;
  @Input() animate: boolean;
  @Input() striped: boolean;
  @Input() value: number;
  @Input() cssClass: string;

  constructor(rebirthNGConfig: RebirthNGConfig) {
    this.type = <any>rebirthNGConfig.progressBar.type;
    this.animate = rebirthNGConfig.progressBar.animate;
    this.striped = rebirthNGConfig.progressBar.striped;
    this.max = rebirthNGConfig.progressBar.max;
  }
}
<div class="progress {{cssClass}}" [ngClass]="{'thin': thin}">
  <div class="progress-bar  {{ type? 'progress-bar-' + type : ''}}"
       [ngClass]="{active: animate, 'progress-bar-striped' : striped}"
       role="progressbar"
       [attr.aria-valuenow]="value" aria-valuemin="0"
       [attr.aria-valuemax]="max" style="min-width: 2em;" [style.min-width.%]="value * 100 / max">{{text}}
  </div>
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""