projects/ngx-list-view/src/lib/components/counter/ngx-counter.component.ts
| selector | ngx-counter |
| templateUrl | ngx-counter.component.html |
Inputs |
customTemplate
|
Default value: |
end
|
Default value: |
label
|
Default value: |
start
|
Default value: |
total
|
Default value: |
import {Component, Input} from '@angular/core';
@Component({
selector: 'ngx-counter',
templateUrl: 'ngx-counter.component.html'
})
export class NgxCounterComponent {
@Input() start = 1;
@Input() end = 1;
@Input() total = 0;
@Input() label = '';
@Input() customTemplate = false;
}
<span *ngIf="total > 0 && !customTemplate">
<strong>
<span>{{start}}</span> - <span>{{end}}</span>
</strong>
of
<strong>{{total}}</strong>
{{label}}
</span>
<ng-template [ngIf]="customTemplate">
<ng-content></ng-content>
</ng-template>