Javascript 如何在jQuery回调中设置ng模型
Javascript 如何在jQuery回调中设置ng模型,javascript,jquery,angularjs,Javascript,Jquery,Angularjs,{{Form::hidden('point',null,['ng-model'=>'evaluationData.point','id'=>'point value'])} 但是当我提交表单时,我没有得到评估数据。请尝试将该脚本包装到指令中 onFinish: function (data) { $('#point-value').val(data.from); } 谢谢你的回复。但是我的ng模型值仍然没有设置。调用了onFinish函数,但是ng模型值仍然没有设置。 onFinish:
{{Form::hidden('point',null,['ng-model'=>'evaluationData.point','id'=>'point value'])}
但是当我提交表单时,我没有得到
评估数据。请尝试将该脚本包装到指令中
onFinish: function (data) {
$('#point-value').val(data.from);
}
谢谢你的回复。但是我的ng模型值仍然没有设置。调用了onFinish
函数,但是ng模型值仍然没有设置。
onFinish: function (data) {
$('#point-value').val(data.from);
}
angular.module('myApp').directive('myDirective', function() {
return {
scope: 'ngModel',
link: function(scope, element, attrs) {
$("#point-range").ionRangeSlider({
min: 0,
max: 10,
from: 1,
from_min: 1,
from_max: 10,
step: 1,
grid: true,
hide_min_max: true,
onFinish: function (data) {
$('#point-value').val(data.from);
scope.ngModel = 'Blah';
scope.$digest();
}
});
}
}
})