diff --git a/src/coffee/directives/api/control.coffee b/src/coffee/directives/api/control.coffee index 5ceef0b92..1ae483eb1 100644 --- a/src/coffee/directives/api/control.coffee +++ b/src/coffee/directives/api/control.coffee @@ -42,9 +42,9 @@ angular.module("uiGmapgoogle-maps.directives.api") else $http.get(scope.template, { cache: $templateCache }) - .success (template) => + .then (template) => templateScope = scope.$new() - controlDiv.append template + controlDiv.append template.data # if a controller is defined on the directive then add it to the template if angular.isDefined scope.controller @@ -54,7 +54,7 @@ angular.module("uiGmapgoogle-maps.directives.api") # use children() rather than content() as the former seems to trim the content control = $compile(controlDiv.children())(templateScope) - .error (error) => + .catch (error) => @$log.error 'mapControl: template could not be found' .then => pushControl(map, control, index) diff --git a/src/coffee/directives/search-box.coffee b/src/coffee/directives/search-box.coffee index 3bf549a63..b1645d74e 100644 --- a/src/coffee/directives/search-box.coffee +++ b/src/coffee/directives/search-box.coffee @@ -42,7 +42,7 @@ angular.module('uiGmapgoogle-maps') $templateCache.put 'uigmap-searchbox-default.tpl.html', '' scope.template = 'uigmap-searchbox-default.tpl.html' $http.get(scope.template, { cache: $templateCache }) - .success (template) => + .then (template) => if angular.isUndefined scope.events @$log.error 'searchBox: the events property is required' return @@ -51,6 +51,6 @@ angular.module('uiGmapgoogle-maps') if not maps.ControlPosition[ctrlPosition] @$log.error 'searchBox: invalid position property' return - new SearchBoxParentModel(scope, element, attrs, map, ctrlPosition, $compile(template)(scope)) + new SearchBoxParentModel(scope, element, attrs, map, ctrlPosition, $compile(template.data)(scope)) new SearchBox() ]