File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
app/views/examples/map-control Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1
1
< div id ="map_canvas " ng-controller ="mainCtrl ">
2
+ < style type ="text/css ">
3
+ .btn-warning {
4
+ background-color : # EC971F ;
5
+ }
6
+ </ style >
2
7
< script type ="text/ng-template " id ="control.tpl.html ">
3
8
< button class = "btn btn-sm btn-primary" ng-class = "{'btn-warning': danger}" ng-click = "controlClick()" > { { controlText} } </ button >
4
9
</ script >
5
10
< ui-gmap-google-map center ="map.center " zoom ="map.zoom " draggable ="true " options ="options ">
6
11
< 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 >
7
17
</ ui-gmap-google-map >
8
- </ div >
18
+ </ div >
Original file line number Diff line number Diff line change @@ -10,4 +10,13 @@ angular.module('appMaps', ['uiGmapgoogle-maps'])
10
10
$scope . danger = ! $scope . danger ;
11
11
alert ( 'custom control clicked!' ) ;
12
12
} ;
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
+ } ) ;
Original file line number Diff line number Diff line change 14
14
"json3" : " ~3.2.4" ,
15
15
"jquery" : " ~2.1.x" ,
16
16
"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" ,
18
18
"bootstrap" : " ~3.2.0" ,
19
19
"lodash" : " >=2.4.1" ,
20
20
"highlightjs" : " ~8.7.0" ,
You can’t perform that action at this time.
0 commit comments