blob: eb08d790403dd95bb056217a7ab61cc883c215fa [file] [log] [blame]
Matteo Scandolo4eb4ccb2016-01-26 11:02:16 -08001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17(function () {
Matteo Scandolo94992fd2016-01-27 13:51:07 -080018 'use strict';
Matteo Scandolo4eb4ccb2016-01-26 11:02:16 -080019
Matteo Scandolo94992fd2016-01-27 13:51:07 -080020 var urlSuffix = '/rs/logout';
Matteo Scandolo4eb4ccb2016-01-26 11:02:16 -080021
Matteo Scandolo94992fd2016-01-27 13:51:07 -080022 angular.module('cordMast', [])
23 .controller('CordMastCtrl', function ($log, $scope, $location, User) {
24 $scope.logout = function () {
25 User.logout()
26 .then(function(){
27 $location.path('/login');
Matteo Scandolo4eb4ccb2016-01-26 11:02:16 -080028 });
Matteo Scandolo94992fd2016-01-27 13:51:07 -080029 };
30 })
31 .directive('mast', function () {
32 return {
33 restrict: 'E',
Matteo Scandolo413c45d2016-01-29 11:40:41 -080034 templateUrl: 'app/fw/mast/mast.html',
35 controller: 'CordMastCtrl',
36 controllerAs: ''
Matteo Scandolo94992fd2016-01-27 13:51:07 -080037 };
Matteo Scandolo413c45d2016-01-29 11:40:41 -080038 })
39 .directive('closeOnRouteChange', function(){
40 return {
41 restrict: 'A',
42 link: function(scope, elem){
43 scope.$on('$routeChangeStart', function(next, current) {
44 elem.removeClass('in');
45 });
46 }
47 }
48 });
Matteo Scandolo4eb4ccb2016-01-26 11:02:16 -080049}());