SmartIT_Extensions/BMC/smart-it-full-helix/scripts/app/common/get-directions-directive.js

21 lines
783 B
JavaScript

"use strict";
(function () {
'use strict';
angular.module('myitsmApp')
.directive('getDirections', ['googleMapService', function (googleMapService) {
return {
restrict: 'E',
template: '<button ux-id="get-directions" 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');
};
}
};
}]);
}());