12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 'use strict';
-
- /* App Module */
-
- var app = angular.module('app', [
- 'ui.bootstrap',
- 'ui.router',
- 'LocalStorageModule',
- 'ngMaterial',
- 'ngMaterialDatePicker',
- 'appSdk'
- ]);
-
- app.config(['$stateProvider', '$urlRouterProvider',
- function($stateProvider, $urlRouterProvider) {
-
- $stateProvider.state('home', {
- url:'/groups?group',
- reloadOnSearch: false,
- templateUrl:'views/home.html',
- controller:'HomeController'
- });
-
- $stateProvider.state('rooms', {
- url:'/rooms?group',
- reloadOnSearch: false,
- templateUrl:'views/home.html',
- controller:'HomeController'
- });
-
- $stateProvider.state('freeroom', {
- url:'/freeroom',
- templateUrl:'views/freeroom.html',
- controller:'FreeRoomController'
- });
-
- $urlRouterProvider.otherwise('/groups');
-
- }])
- .directive('dateNow', ['$filter', function($filter) {
- return {
- link: function( $scope, $element, $attrs) {
- $element.text($filter('date')(new Date(), $attrs.dateNow));
- }
- };
- }])
- .run(['$rootScope', '$state', 'DataShareBusiness', 'GroupsBusiness', 'StaffsBusiness', 'RoomsBusiness', '$mdDateLocale', '$filter',
- function ($rootScope, $state, DataShareBusiness, GroupsBusiness, StaffsBusiness, RoomsBusiness, $mdDateLocale, $filter) {
-
-
- var promiseLoadEntities = {
- id: "promiseLoadEntities",
- loaderGroups: ["toolbar"],
- groups: ["sidebar"]
- };
- GroupsBusiness.getAll(promiseLoadEntities).then(function(groups)
- {
- StaffsBusiness.getAll(promiseLoadEntities).then(function(staffs)
- {
- RoomsBusiness.getAll(promiseLoadEntities).then(function(rooms)
- {
- DataShareBusiness.Groups = groups;
- DataShareBusiness.Staffs = staffs;
- DataShareBusiness.Rooms = rooms;
- });
- });
- });
-
- $mdDateLocale.firstDayOfWeek = 1;
- $mdDateLocale.formatDate = function(date) {
- return $filter("date")(date, DataShareBusiness.DateFormat);
- };
- }]);
|