app-navbar.directive.js
964 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(function() {
'use strict';
angular
.module('dialoga')
.directive('appNavbar', appNavbar);
/** @ngInject */
function appNavbar() {
/** @ngInject */
function NavbarController(AuthService, $log) {
$log.debug('NavbarController');
var vm = this;
vm.AuthService = AuthService;
vm.$log = $log;
}
// NavbarController.prototype.scrollTo = function (hash){
// var $el = angular.element('#' + hash);
// angular.element('html,body').animate({scrollTop: $el.offset().top}, 'slow');
// };
NavbarController.prototype.onClickLogout = function (){
var vm = this;
vm.AuthService.logout();
};
var directive = {
restrict: 'E',
templateUrl: 'app/components/app-navbar/app-navbar.html',
scope: {
creationDate: '='
},
controller: NavbarController,
controllerAs: 'vm',
bindToController: true
};
return directive;
}
})();