Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

$http's deprecated custom callback methods #1990

Merged
merged 3 commits into from
Dec 31, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/coffee/directives/api/control.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/coffee/directives/search-box.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ angular.module('uiGmapgoogle-maps')
$templateCache.put 'uigmap-searchbox-default.tpl.html', '<input type="text">'
scope.template = 'uigmap-searchbox-default.tpl.html'
$http.get(scope.template, { cache: $templateCache })
.success (template) =>
.then (template) =>
Copy link
Contributor

@nmccready nmccready Dec 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll need .then (template) => template.data or .then ({data}) => here as well.

if angular.isUndefined scope.events
@$log.error 'searchBox: the events property is required'
return
Expand Down