뷰 정보가 포함 된 개체 모델이 있습니다. 이 객체에 대해 몇 가지 변경 작업을 수행 한 다음 적용을 사용하면 슬라이더가 아닌 모든 구성 요소가 업데이트됩니다. 창에서 크기를 조정 한 후에 만 슬라이더가 업데이트 된 것을 볼 수 있습니다. 어떤 생각?적용 후 Slider가 업데이트되지 않음
$rootScope.$on('newPrintSelected', function (event, selectedPrinter) {
StorageModule.storage.find(collectionName, {_id : selectedPrinter.printer_hardware._id}, function(error, data){
if (error) { //Not Found
console.error("Ops. There is something wrong with this action...");
}else {
if(data[0].printOptions == null){
$scope.options = angular.copy($scope.default);
$scope.options.layerThickness = 30 - ($scope.options.layerThickness * 100);
$scope.persistedOptions = angular.copy($scope.default);
$scope.persistedOptions.layerThickness = 30 - ($scope.persistedOptions.layerThickness * 100);
}else{
data[0].printOptions.layerThickness = 30 - (data[0].printOptions.layerThickness * 100);
$scope.options = angular.copy(data[0].printOptions);
$scope.persistedOptions = angular.copy(data[0].printOptions);
}
}
$scope.selectedPrinterHardware = angular.copy(data[0]);
console.warn($scope.options);
$scope.$apply();
});
});
슬라이더 :
<div class="slider">
<rzslider rz-slider-model="options.infill" rz-slider-options="slider.infill">
</rzslider>
</div>
$ scope.options 모델로 사용되는 객체입니다. console.warn ($ scope.options); 객체가 정확함을 보여줍니다.
수정 : 슬라이더가 showen 때마다 들어
setTimeout(function(){ $scope.$broadcast('rzSliderForceRender'); }, 25);
.
문서에 나와 있습니다. 나는 그 일에 대해 유감이다.
관련 코드를 보여주세요. – ajmajmajma
슬라이더는 어디에 있습니까? – Manu
@ajmajmajma 업데이트 됨 –