I was just going through the examples for a angular and openlayers directive HERE and came across the following example:
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<script>
var app = angular.module('demoapp', ['openlayers-directive']);
app.controller('DemoController', [ '$scope', function($scope) {
angular.extend($scope, {
center: {
lat: 0,
lon: 0,
autodiscover: true
}
});
}]);
</script>
</head>
<body ng-controller="DemoController">
<openlayers ol-center="center" height="400px"></openlayers>
<h1>Center autodiscover example</h1>
<form>
Latitude : <input type="number" step="any" ng-model="center.lat" />
Longitude : <input type="number" step="any" ng-model="center.lon" />
Zoom : <input type="number" step="any" ng-model="center.zoom" />
<button ng-click="center.autodiscover=true">Discover position</button>
</form>
</body>
</html>
The example can be seen as a live example HERE.
My question is about the files being loaded, I don't quite understand why the below script being loaded:
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
What is the purpose of the above script ?
EDIT:: : i found out the git repo and the docs here for this module in angular HERE. , but i still don't understand the purpose of this script , the documentation does't even have a single example.
I have coded in jQuery a fair bit , so can somebody explain this in jQuery terms ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…