This commit is contained in:
annabakouli 2017-12-08 10:07:57 +02:00
commit 65831fff1f
4 changed files with 13 additions and 10 deletions

View File

@ -27,4 +27,8 @@
.ui-steps.steps-custom .ui-steps-item .ui-steps-title {
color: #555555;
}
.ng-sidebar {
width: 40%;
}

View File

@ -26,7 +26,6 @@
</form>
</div>
</div>
</ng-sidebar-container>
</div>

View File

@ -1 +1 @@
<p-progressBar [value]="value"></p-progressBar>
<p-progressBar [value]="value" [style]="{'height': '30px'}"></p-progressBar>

View File

@ -7,8 +7,8 @@ import { FormGroup, FormControl, FormArray } from '@angular/forms'
templateUrl: './progress-bar.component.html',
})
export class ProgressBarComponent implements OnInit {
@Input() formGroup: FormGroup
@Input("progressValueAccuracy") public accuracy: number = 2
@Input() formGroup: FormGroup
@Input("progressValueAccuracy") public accuracy: number = 1
constructor(private visibilityRulesService: VisibilityRulesService) { }
@ -16,12 +16,12 @@ export class ProgressBarComponent implements OnInit {
ngOnInit() {
this.formGroup
.valueChanges
.subscribe(control => {
var progressSoFar = this.countFormControlsWithValue(this.formGroup);
var total = this.getFormControlDepthLength(this.formGroup);
var perc = (progressSoFar / total) * 100;
this.value = Number.parseFloat(perc.toPrecision(this.accuracy));
})
.subscribe(control => {
var progressSoFar = this.countFormControlsWithValue(this.formGroup);
var total = this.getFormControlDepthLength(this.formGroup);
var perc = (progressSoFar / total) * 100;
this.value = Number.parseFloat(perc.toPrecision(this.accuracy));
});
}
countFormControlsWithValue(form: FormGroup): number {