-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.js
25 lines (24 loc) · 894 Bytes
/
search.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
angular.module('bharath-directives', ['ui.bootstrap']);
angular.module('bharath-directives')
.directive('countrySearch', function () {
return {
restrict: 'E',
templateUrl: 'bower_components/bharath-directives/search.html',
replace: true,
controller: function ($scope, $http) {
$scope.getLocation = function (val) {
return $http.get('GOOGLE_API_URL', {
params: {
address: val,
sensor: false
}
}).then(function (response) {
return response.data.results.map(function (item) {
return item.formatted_address;
});
});
};
}
};
});