我正在使用Angular-Leaflet Directive,并试图弄清楚如何使用输入文本框中的数据和标记对象的data属性来过滤标记。我尝试的每一件事都会导致一个角度无限的摘要循环。
这就是我到目前为止所知道的:
var app = angular.module('mapApp', ['leaflet-directive']);
//Filter
$scope.filterTerm;
//Controller
app.controller("mapController", ['$scope', function ($scope) {
$scope.center = {
lat: 53.4239,
lng: -7.9407,
zoom: 7
};
//declare sample points
$scope.samplePoints = [
{
lat: 53.37,
lng: -9.48,
data : 'K',
hidden: true
},
{
lat: 54.2314131,
lng: -8.5744558,
data: 'L',
hidden: true
}
];
}]);和html
<input type="text" ng-model="filterTerm" />
<leaflet center="center" markers="markers| markers="markers | filter: filterTerm " style="height: 900px;"></leaflet>我已经使用了this堆栈溢出答案,并且已经尝试了几个小时,但是我尝试的所有东西都得到了相同的错误。非常感谢您的帮助。
发布于 2016-06-15 17:33:14
这是一个Visual Studio 2013问题--我执行了Visual Studio 2013的全新安装,并解决了问题。
https://stackoverflow.com/questions/37815402
复制相似问题