1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 'use strict';
-
- /* App Module */
-
- var app = angular.module('app', [
- 'ui.bootstrap',
- 'ui.router',
- 'LocalStorageModule',
- 'ngMaterial',
- 'appSdk'
- ]);
-
- app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider',
- function($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) {
-
- //$locationProvider.html5Mode(true);
-
- $stateProvider.state('home',{
- url:'/',
- reloadOnSearch: false,
- templateUrl:'views/home.html',
- controller:'HomeController'
- });
-
- $urlRouterProvider.otherwise('/');
-
- }])
- .directive('dateNow', ['$filter', function($filter) {
- return {
- link: function( $scope, $element, $attrs) {
- $element.text($filter('date')(new Date(), $attrs.dateNow));
- }
- };
- }])
- .run(['$rootScope', '$state', '$location', 'DataShareBusiness', 'GroupsBusiness',
- function ($rootScope, $state, $location, DataShareBusiness, GroupsBusiness) {
- $rootScope.$on('$stateChangeError', function (e, curr, prev) {
- //$state.go('/');
- });
-
- $rootScope.$watch(function(){ return Object.keys($location.search())[0] }, function(){
- if (DataShareBusiness.Groups != null) {
- DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
- }
- });
-
- var promiseLoadGroups = {
- id: "promiseLoadGroups",
- loaderGroups: ["toolbar"],
- groups: ["sidebar"]
- };
- GroupsBusiness.loadAll(promiseLoadGroups).then(function(data)
- {
- DataShareBusiness.setFromSearchString(Object.keys($location.search())[0]);
- });
- }]);
|