blob: eb08d790403dd95bb056217a7ab61cc883c215fa [file] [log] [blame]
Matteo Scandolobf14f882016-06-02 10:01:34 -07001/*
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 () {
18 'use strict';
19
20 var urlSuffix = '/rs/logout';
21
22 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');
28 });
29 };
30 })
31 .directive('mast', function () {
32 return {
33 restrict: 'E',
34 templateUrl: 'app/fw/mast/mast.html',
35 controller: 'CordMastCtrl',
36 controllerAs: ''
37 };
38 })
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 });
49}());