cobuild-angular-stack
Version:
Base stack angular sass jade gulp
51 lines (38 loc) • 1.56 kB
JavaScript
(function () {
'use strict';
angular.module('uniko.authSatellizer')
.controller('NavBarController', NavBarController);
NavBarController.$inject = ['$scope', 'CoupleAccount', 'LoopBackAuth', 'toastr', '$uibModal','$rootScope', 'Utils', 'lodash'];
function NavBarController($scope, CoupleAccount, LoopBackAuth, toastr, $uibModal, $rootScope, Utils, lodash) {
var controller = this;
$scope.user = CoupleAccount.getCurrent();
$scope.isFullAccount = !!($scope.user.payInformationData && $scope.user.payInformationData.isPaid);
$scope.is2FA = true;
$scope.isExperiences = true;
Utils
.list()
.then(function (response) {
var list = response.data;
var aux = lodash.find(list, {name: 'is2FA'}).value.is2FA;
if (aux) {
$scope.user.$promise.then(function (a) {
$scope.is2FA = a.is2FA;
});
}
});
$rootScope.loginModal = function(){
var modalInstance = $uibModal.open({
animation: true,
templateUrl: '/partials/auth.login.html',
size: 'lg',
controllerAs: 'LoginCtrl',
controller: 'LoginCtrl'
});
modalInstance.result.then(function (selectedItem) {
//console.log("selected")
}, function () {
//console.log("dismiss")
});
}
}
})();