123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- '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:'/?group',
- reloadOnSearch: false,
- templateUrl:'views/home.html',
- controller:'HomeController'
- });
-
- $stateProvider.state('freeroom',{
- url:'/freeroom',
- templateUrl:'views/freeroom.html',
- controller:'FreeRoomController'
- });
-
- $urlRouterProvider.otherwise('/');
-
- }])
- .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);
- };
- }]);
|