

import SelectCtrl from './controllers/SelectCtrl';
import CollectCtrl from './controllers/CollectCtrl';
import ModelService from './services/ModelService';
import featureFilter from './filters/featureFilter';
import labelFilter from './filters/labelFilter';

angular.module('myApp', ['ui.bootstrap', 'ui.router', 'ngTagsInput', 'timer'])
	.value('host', 'jactivity.teco.edu')
	.service('ModelService', ModelService)
	.controller('SelectCtrl', SelectCtrl)
	.controller('CollectCtrl', CollectCtrl)
	.filter('feature', featureFilter)
	.filter('label', labelFilter)
	.service('sharedConfig', function () {
        var features = {};
        var labels = {};

        return {
            getFeatures: function () {
                return features;
            },
            getLabels: function () {
                return labels;
            },
            setConfig: function(_features, _labels) {
                features = _features;
                labels = _labels;
            }
        };
	 })
	.config(['$httpProvider', '$stateProvider', '$urlRouterProvider',
  function($httpProvider, $stateProvider, $urlRouterProvider) {

    $stateProvider
      .state('select', {
        url: '/select',
        templateUrl: 'select.html',
        controller: 'SelectCtrl'
      })
      .state('collect', {
        url: '/collect',
        templateUrl: 'collect.html',
        controller: 'CollectCtrl',
      });

    $urlRouterProvider.otherwise('/select');
  }
]);
