var angular = require('angular');
require('./modules');
require('uiRouter');

var module = angular.module('linker.routes');

module.config(function($stateProvider) {
  $stateProvider
    .state('linker-linkerSelfDept', {
      url: '/linker/selfdept',
      data: {
        title: '本部门联系人',
        url: 'linker-linkerSelfDept'
      },
      templateUrl: 'views/linker/selfdeptRemote.tpl.html',
      controller: 'SelfDeptCtrl as selfDeptCtrl',
      resolve: {
        type: function() {
          return 'user';
        }
      }
    })
    .state('linker-linkerAllusers', { //弃用，从缓存中获取
      url: '/linker/allusers',
      data: {
        title: '所有联系人',
        url: 'linker-linkerAllusers'
      },
      templateUrl: 'views/linker/allusers.tpl.html',
      controller: 'LinkerTreeCtrl',
      resolve: {
        type: function() {
          return 'user';
        }
      }
    })
    .state('linker-linkerAllusersRemote', {
      url: '/linker/allusersremote',
      data: {
        title: '所有联系人',
        url: 'linker-linkerAllusersRemote'
      },
      templateUrl: 'views/linker/allUsersRemote.tpl.html',
      controller: 'AllUsersCtrl as allUsersCtrl',
      resolve: {
        type: function() {
          return 'user';
        }
      }
    });
});
