21 lines
760 B
JavaScript
21 lines
760 B
JavaScript
"use strict";
|
|
(function () {
|
|
'use strict';
|
|
angular.module('myitsmApp')
|
|
.directive('getDirections', ['googleMapService', function (googleMapService) {
|
|
return {
|
|
restrict: 'E',
|
|
template: '<button class="profile__get-directions-btn" ng-click="getDirections()">{{"common.button.getDirections" | i18n}}</button>',
|
|
scope: {
|
|
destination: '='
|
|
},
|
|
link: function (scope) {
|
|
scope.getDirections = function () {
|
|
var url = googleMapService.getDirectionUrl(scope.destination);
|
|
window.open(url, '_blank');
|
|
};
|
|
}
|
|
};
|
|
}]);
|
|
}());
|