{"size": 1101, "ext": "js", "max_stars_repo_path": "app/controller/AdminCtrl.js", "max_stars_repo_name": "Ivarpoiss/wordnet-workbench-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/controller/AdminCtrl.js", "max_issues_repo_name": "Ivarpoiss/wordnet-workbench-client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/controller/AdminCtrl.js", "max_forks_repo_name": "Ivarpoiss/wordnet-workbench-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.4571428571, "max_line_length": 114, "alphanum_fraction": 0.5467756585}
/**
 * Created by ivar on 25.11.15.
 */

define([
    'angularAMD'
], function (angularAMD) {

    angularAMD.controller('AdminCtrl', ['$scope','$state', 'AuthService', function ($scope, $state, authService) {

        $scope.tabs = [
            { heading: "Sense relation types", route:"admin.sensereltype", active:false },
            { heading: "Synset relation types", route:"admin.synsetreltype", active:false },
            //{ heading: "External reference types", route:"admin.extreftype", active:false },
            { heading: "Sense styles", route:"admin.sensestyle", active:false }/*,
            { heading: "Users", route:"admin.user", active:false }*/
        ];

        $scope.go = function(route){
            $state.go(route);
        };

        $scope.active = function(route){
            return $state.is(route);
        };

        $scope.$on("$stateChangeSuccess", function() {
            console.log('Admin state change success');
            $scope.tabs.forEach(function(tab) {
                tab.active = $scope.active(tab.route);
            });
        });

    }]);
});