title: nouislider angular 2 format tooltips
body: <p>I want to convert the tooltip values from seconds to a date. But there's a catch, there's an initial date (startTime), and I want to add the tooltip values (seconds) to this date, and show it in the tooltip.</p>
  
  <p>That is, if my initial time is 05:00:00 and I move the left handle 5 seconds, it should show 05:00:05.</p>
  
  <p>The format in the tooltips is working, I have managed to change the value as date or even to add strings to it.</p>
  
  <p>I'm working in Angular 2, <strike>when I call the method <code>this.formatTooltipTimeDate(value)</code>, I get the error.</p>
  
  <blockquote>
    <p>ERROR TypeError: Cannot read property 'formatTooltipTimeDate' of
    undefined
    </strike></p>
  </blockquote>
  
  <p>This is now working by the change suggested by @Stefan Svrkota , but, now I can only see "undefined" in both tooltips. </p>
  
  <p>I added a message in the console, where I can see that the date is correctly formatted as a string, but the value returned is still undefined. </p>
  
  <p>Tooltip configuration:</p>
  
  <p><strong>component.ts</strong></p>
  
  <pre><code>    this.sliderConfig = {
        start: 0,
        connect: true,
        range: {
          min: 0,
          max: rangeTime
        },
        format: {
          from: Number,
          to: (value) =&gt; {                    
            this.formatTooltipTimeDate(value).subscribe(
              data =&gt; {
                console.log('new tooltip format ', data);
                return data;
              }
            );
          }
        },
        step: 1
      };
  
  
    formatTooltipTimeDate(seconds): Observable&lt;string&gt;{
      let t = new Date(this.startTime);
      let newDate;
      t.setSeconds(t.getSeconds() + seconds);
  
          // Formate Date: HH:MM:SS
          let hour = this.formatTwoDigits(t.getHours());
          let minute = this.formatTwoDigits(t.getMinutes());
          let second = this.formatTwoDigits(t.getSeconds());
          newDate = hour + ':' + minute + ':' + second;
          return Observable.of(newDate);
    }
  </code></pre>
  
  <p><strong>component.html</strong></p>
  
  <pre><code>  &lt;nouislider class="nouislider" [config]="sliderConfig" [tooltips]="[ true, true ]" [(ngModel)]="someRange" (change)="event($event)"&gt;&lt;/nouislider&gt;
  </code></pre>