Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我第一次在 yandex 地图上单击时,我想要更新变量。但它不起作用。点击地图的处理程序肯定被调用,但变量值没有更新。这是jsfiddle。当我点击地图时,我想要更新filter.step变量。
filter.step
如果您更改非角度组件内的任何内容,则它不会运行$digest以对其链接的任何位置进行更改。
$digest
您需要对非角度组件应用更改。
尝试$scope.$apply()
$scope.$apply()
像这样
$scope.$apply(function(){ $scope.filter.step = 2; })
DEMO