'use strict';

var angular = require('angular');
require('../modules');
require('../services/LoginService');
require('../LoginModal');

var module = angular.module('login.directives');

module.directive('otherLogin', function(LoginService, LoginModal) {
  return {
    restict: 'EA',
    template: '<a ng-click="otherLogin()">登录其他用户</a>',
    link: function(scope) {
      scope.otherLogin = function() {
        return LoginService.logout().then(function() {
          return LoginModal.show();
        });
      };
    }
  };
});