我的问题与在角度2中获取mdslider值不同 ? 我需要将滑块的值传递给组件,而不仅仅是使用局部变量。而且还更改了Angular Material,因此滑块现在需要将$ event对象传递给组件函数。
我在Angular 4中有一个Angular Material滑块组件:
的HTML
<mat-slider min="430" max="500" step="10" value="450" (input)="pitch($event)"></mat-slider>
Run Code Online (Sandbox Code Playgroud)
TS
import { Component, OnInit } from '@angular/core';
import { Inject, Injectable } from '@angular/core';
import { MatSlider } from '@angular/material';
import { AudioContext } from 'angular-audio-context';
@Component({
selector: 'pitch-slider',
templateUrl: './pitch-slider.component.html',
styleUrls: ['./pitch-slider.component.css']
})
export class PitchSliderComponent implements OnInit {
constructor(private _audioContext: AudioContext) { }
ngOnInit() {
}
}
Run Code Online (Sandbox Code Playgroud)
我对Angular很陌生,在获取滑块的当前值时遇到麻烦。它似乎不适用于$ event对象?