Comments (7)
Hey,
just a a shout for changing dynamically the range for angular2 or higher, I used the advices with the view child and update options tl;dr;
front:
<nouislider [connect]="true" [step]="1" [min]="modelMonthlyCost.min" [max]="modelMonthlyCost.max" [(ngModel)]="monthlyCostRange" [ngModelOptions]="{standalone: true}" (change)="changeMonthlyCost()" #monthlyCostSlider></nouislider>
back:
@ViewChild('monthlyCostSlider') public monthlyCostSlider: NouisliderComponent
.
.
.
this.monthlyCostRange = [+newModelMonthlyCost.min, +newModelMonthlyCost.max];
if (this.monthlyCostSlider.slider) this.monthlyCostSlider.slider.updateOptions({ start: [+newModelMonthlyCost.min, +newModelMonthlyCost.max], range: { min: +newModelMonthlyCost.min, max: +newModelMonthlyCost.max } });
Hope it helps, works for me
from ng2-nouislider.
You can do like this:
this.priceSliderRef.slider.set([+valueToSet1, +valueToSet2]);
from ng2-nouislider.
@smikey It will require adding https://angular.io/docs/ts/latest/api/core/index/OnChanges-class.html and using https://refreshless.com/nouislider/more/#section-update Can you do PR with it?
from ng2-nouislider.
see my comment here: #55
from ng2-nouislider.
I have hit the same limitation with this component, but as I have just started using angular so do not have the skills necessary to fix this myself.
Looking at the documentation here https://refreshless.com/nouislider/more/ it appears that the wrapped control supports the capability.
from ng2-nouislider.
Hi Talanoff
Can you pls post ur code.
How r u getting the nouislider objects.
Like update option.
Can you pls help
from ng2-nouislider.
I got it working. Thank you
from ng2-nouislider.
Related Issues (20)
- suddenly started having error TS2305: Module '"../../node_modules/ng2-nouislider/ng2-nouislider"' has no exported member 'NouisliderModule'. HOT 4
- How to find which handle is being dragged in custom event? HOT 2
- Return all parameters in event HOT 2
- Materialize design
- Component does not work with formControlName attribute HOT 3
- Error when setting start with the value of a variable. HOT 1
- Angular 9 support HOT 1
- Angular Build WARNING - depends on 'nouislider'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies HOT 4
- Slider snaps on manually setting a value between steps HOT 3
- TypeError: Cannot read property 'from' of undefined at NouisliderComponent.toValues HOT 1
- Potentially not compatible with Ivy warning HOT 1
- ng2-nouislider vertical, direction rtl issue HOT 1
- Add handles dynamically in reactive form
- Keyboard support handle issue when multi connect option is used. HOT 1
- The website is blocked in India HOT 1
- Angualr 12/13/14 new lib format HOT 1
- is this lib dead ? HOT 2
- Angular 14 [(ngModel])
- NouisliderModule does not have a module def (ɵmod property) for Angular16 HOT 1
- Disabled attribute doesnt work as expected HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-nouislider.