Javascript Angular 中的插件没有出现,但是 HTML 有

Javascript Plugins in Angular Do not show up, but HTML is there

我正在尝试为范围滑块使用几个不同的 javascript 库。但是,对于我使用的每一个,我在浏览器中都看不到任何东西——尽管我可以看到正在生成 HTML 。我决定使用 nouislider。

import { Component, ViewChild, ElementRef, OnInit, AfterViewInit} from '@angular/core';
import * as nouislider from 'nouislider';

@Component({
  selector: 'app-root',
  template: '<div #here></div>',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements AfterViewInit {

  @ViewChild('here') range : ElementRef

  ngAfterViewInit() {
    nouislider.create(this.range.nativeElement,
      {
        start: [20, 80],
        connect: true,
        range: {
          'min': 0,
          'max': 100
        }
    });
  }
}

结果:

有什么我想念的吗?这是一个空的 Angular 4 项目。我知道已经制定了针对 nouislider 的指令。但是我也无法让他们工作。

I do not see anything in the browser - even though I can see the HTML being generated

你添加了 CSS 了吗?