Closed tatsujb closed 6 years ago
ok so even if having a unitiated value seems to work because it defaults to "to" until hydrated by the observable it actually causes an issue. simply initiate your "max" value at the same number as your "to" this way it mimicks the behavior of the table/dataset being hydrated under your eyes but doesn't suffer from the above bug.
actually no. false impression I get the bug anyways. basically as soon as the var that is going to be passed to ng2-ion-range-slider is so much as touched near or far by an observable, ng2-ion-range-slider craps out.
since I'm new to this is there a way to have a var with a one-time only update?
I tried :
if(this.init){
this.max = data.length;
this.init = false;
}
to no avail. it seems there's a sort of "contamination" of observables to other vars they touch?
alright so it's as dumb as bricks but the solution was :
<ion-range-slider *ngIf="max" #sliderElement
type="double"
[min]="min"
[max]="max"
[from]="from"
[to]="to"
[min_interval]="min_interval"
[max_interval]="max_interval"
grid="true"
drag_interval="true"
(onFinish)="myOnFinish($event.from , $event.to)">
</ion-range-slider>
yes it's as dumb as *ngIf="max"
when using an observable there will be a millisecond where it's value is "undefined" (which will not even register if watching the value with console.log) even if the value was previously instantiated and one such value will partially crash this plugin.
I have this setup. with a hard coded max value (
max="9000"
) I can slide min, max and interval.when max is a var like above all three default to the interval I can't widen the gap sometimes I can decrease it and there is a substantial amount of lag.
Windows 10 pro 64bit
Chrome Version 64.0.3282.167 (Official Build) (64-bit) node: v8.9.4 npm: 5.6.0
package.json :