Skip to content

Commit 43b850f

Browse files
committed
Merge pull request angular-ui#1815 from mehanika/share-button
Inline template in map-control directive - Documentation
2 parents 32066a6 + 509e0f9 commit 43b850f

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
<div id="map_canvas" ng-controller="mainCtrl">
2+
<style type="text/css">
3+
.btn-warning {
4+
background-color:#EC971F;
5+
}
6+
</style>
27
<script type="text/ng-template" id="control.tpl.html">
38
<button class="btn btn-sm btn-primary" ng-class="{'btn-warning': danger}" ng-click="controlClick()">{{controlText}}</button>
49
</script>
510
<ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="options">
611
<ui-gmap-map-control template="control.tpl.html" position="top-right" controller="controlCtrl" index="-1"></ui-gmap-map-control>
12+
<ui-gmap-map-control>
13+
<div ng-controller="inlineControlCtrl">
14+
<button class="btn btn-sm btn-primary" ng-class="{'btn-warning': danger}" ng-click="controlClick()">{{controlText}}</button>
15+
</div>
16+
</ui-gmap-map-control>
717
</ui-gmap-google-map>
8-
</div>
18+
</div>

app/views/examples/map-control/script.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@ angular.module('appMaps', ['uiGmapgoogle-maps'])
1010
$scope.danger = !$scope.danger;
1111
alert('custom control clicked!');
1212
};
13-
});
13+
})
14+
.controller('inlineControlCtrl',function($scope){
15+
$scope.controlText = 'I\'m a custom control from inline template';
16+
$scope.danger = false;
17+
$scope.controlClick = function () {
18+
$scope.danger = !$scope.danger;
19+
alert('custom control from inline template clicked!');
20+
};
21+
22+
});

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"json3": "~3.2.4",
1515
"jquery": "~2.1.x",
1616
"es5-shim": "~2.0.8",
17-
"share-button": "~0.0.3",
17+
"share-button": "git+https://github.com/carrot/share-button.git#0.0.3",
1818
"bootstrap": "~3.2.0",
1919
"lodash": ">=2.4.1",
2020
"highlightjs": "~8.7.0",

0 commit comments

Comments
 (0)