{"size": 557, "ext": "js", "max_stars_repo_path": "sample/static/pages/logout.directive.js", "max_stars_repo_name": "puzzle/ng-user-auth", "max_stars_repo_stars_event_min_datetime": "2015-12-11T14:30:30.000Z", "max_stars_repo_stars_event_max_datetime": "2017-12-07T20:33:55.000Z", "max_issues_repo_path": "sample/static/pages/logout.directive.js", "max_issues_repo_name": "puzzle/ng-user-auth", "max_issues_repo_issues_event_min_datetime": "2016-02-29T14:45:30.000Z", "max_issues_repo_issues_event_max_datetime": "2016-02-29T14:57:52.000Z", "max_forks_repo_path": "sample/static/pages/logout.directive.js", "max_forks_repo_name": "puzzle/ng-user-auth", "max_forks_repo_forks_event_min_datetime": "2016-02-19T08:49:23.000Z", "max_forks_repo_forks_event_max_datetime": "2017-06-13T20:35:50.000Z"}
{"max_stars_count": 4, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 17.40625, "max_line_length": 56, "alphanum_fraction": 0.5673249551}
(function () {
  'use strict';

  angular
    .module('ngUserAuthSample')
    .directive('logout', logoutDirective);

  function logoutDirective() {
    var directive = {
      scope: {},
      controller: LogoutController,
      controllerAs: 'vm',
      bindToController: true
    };

    return directive;
  }

  /** @ngInject */
  function LogoutController($state, ngUserAuthService) {
    activate();

    ////////////

    function activate() {
      ngUserAuthService.logout().then(function () {
        $state.go('login');
      });
    }
  }
})();
