Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 更改html滑块输入时将数据传递给角度函数_Angularjs_Angularjs Directive_Angularjs Scope - Fatal编程技术网

Angularjs 更改html滑块输入时将数据传递给角度函数

Angularjs 更改html滑块输入时将数据传递给角度函数,angularjs,angularjs-directive,angularjs-scope,Angularjs,Angularjs Directive,Angularjs Scope,我想在AngularJs中传递一个关于更改html滑块输入的值 <input type="range" value="30" min="0" max="0" id="set-value" /> 我不想使用任何插件或任何东西。只是一个简单的答案。谢谢。:) 首先需要使用带有值的ng model指令,该指令将在控制器$scope中可用,然后将ng change事件放置在该输入元素上 标记 <input type="range" value="30" min="0" max="0"

我想在AngularJs中传递一个关于更改html滑块输入的值

<input type="range" value="30" min="0" max="0" id="set-value" />

我不想使用任何插件或任何东西。只是一个简单的答案。谢谢。:)

首先需要使用带有值的
ng model
指令,该指令将在控制器
$scope
中可用,然后将
ng change
事件放置在该输入元素上

标记

<input type="range" value="30" min="0" max="0" id="set-value" 
  ng-model="sliderModel" ng-change="passValueHere(sliderModel)"/>

<input type="range" value="30" min="0" max="0" id="set-value" 
  ng-model="sliderModel" ng-change="passValueHere(sliderModel)"/>