question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I am trying to use this with angualar 4

See original GitHub issue

I am using the angular cli. I have done npm install of ng2-nouislider and nouislider. later i done this. import { NouisliderModule } from ‘ng2-nouislider’; and in the angualr-cli.json i added the ~nouislider/distribute/nouislider.min.css"

this is my.ts import {Component, ViewChild, ElementRef, NgModule, VERSION} from ‘@angular/core’ import {BrowserModule} from ‘@angular/platform-browser’ import { NouisliderModule } from ‘ng2-nouislider’;

@Component({ selector: ‘my-app’, template: <nouislider #slider [config]="someKeyboardConfig"></nouislider> , }) export class App { @ViewChild(‘slider’, { read: ElementRef }) slider: ElementRef;

someKeyboardConfig: any = { behaviour: ‘drag’, connect: [true, true,true], start: [20, 40], keyboard: true, // same as [keyboard]=“true” step: 1, pageSteps: 10, // number of page steps, defaults to 10 range: { min: 0, max: 100 }, pips: { mode: ‘count’, density: 2, values: 6, stepped: true } }; ngAfterViewInit() { this.func(); }

func() { const connect = this.slider.nativeElement.querySelectorAll(‘.noUi-connect’); const classes = [‘c-1-color’, ‘c-2-color’, ‘c-3-color’]; console.log(connect.length); for ( let i = 0; i < connect.length; i++ ) { connect[i].classList.add(classes[i]); } } }

I cannot see the slider on html

in documentation of ng2-slider it says to add it in the system.config.js . and Unfortunately we donot have system.js in angular4 can you explain the steps how to use this library with webpack.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
kiqqcommented, Dec 19, 2017
  1. Initial handle value start: [24, 34], or someRange = [24, 34];

  2. Tooltips - create own formatter for day/days postfix: import { NouiFormatter } from "ng2-nouislider";

tooltips: [new MyFormatter, new MyFormatter],

export class MyFormatter implements NouiFormatter {
  to(value: number): string {
    let output = value + " Day";
    if (value != 1) { output += "s";}
    return output;
  }

  from(value: string): number {
    return Number(value.split(" ")[0]);
  }
}
  1. Edit class “noUi-tooltip” for expected result in styles.css:
.noUi-tooltip{
    background-color: orange;
    color: white;
    padding: 10px 10px;
    border-radius: 0;
}

.noUi-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: orange transparent transparent transparent;
}
  1. Remove Chrome’s focus:
div:focus{
    outline: none;
}
0reactions
chandupurduecommented, Dec 20, 2017

While dragging

On Wed, Dec 20, 2017 at 5:20 PM, Chandra Sekhar Nandipati < chandu.pegasian@gmail.com> wrote:

I am using version 9.0.0 in this when I dragging the tooltip is getting zoomed in. I donot want any action on tooltip

On Tue, Dec 19, 2017 at 2:50 PM, kiqq notifications@github.com wrote:

Here is project created from earlier comments so you can check what is wrong in your code: https://stackblitz.com/edit/angular-yigy1l

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tb/ng2-nouislider/issues/140#issuecomment-352867525, or mute the thread https://github.com/notifications/unsubscribe-auth/AXxC_qmLOHN61kHFPyDwfIJQC5VcFjtTks5tCBORgaJpZM4REdYB .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting started with Angular
To get the most out of this tutorial, you should already have a basic understanding of the following. HTML · JavaScript · TypeScript....
Read more >
Angular 4 tutorial [closed] - typescript - Stack Overflow
My team needs to study angular 4 for our next project. I was trying to search tutorial but with almost no success, I...
Read more >
How to use Angular 4 with ASP.NET MVC 5 - dotnetthoughts
This post is about how to use Angular 4 with ASP.NET MVC5. ... Now I am trying to publish the MVC project and...
Read more >
Working with Angular 4 Forms: Nesting and Input Validation
Validating user inputs is an essential part of any robust web application. Angular 4 makes it especially easy for both template-driven and reactive...
Read more >
How to Create Your First Angular 4 Application - YouTube
A powerful framework for both mobile and desktop development, Angular is one of the most popular JavaScript frameworks out there.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found