'use strict' angular.module('myHR').factory('SwapLang', ['$mdDialog', function($mdDialog){ return { getString: function(obj){ let str = '' if (obj != undefined){ str = obj[getLang()] } return str }, getAlert: function(alertcode, textContent){ let alert = $mdDialog.alert() .clickOutsideToClose(true) .title(MyCode[alertcode]) .textContent(textContent) .ok(MyCode[242]) return $mdDialog.show(alert) }, getConfirm : function (alertcode) { let confirm = $mdDialog.confirm() .title(MyCode[alertcode]) .ok(MyCode[240]) .cancel(MyCode[241]); return $mdDialog.show(confirm) } } }]);