Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

app.js 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. 'use strict';
  2. /* App Module */
  3. var app = angular.module('app', [
  4. 'ui.bootstrap',
  5. 'ui.router',
  6. 'LocalStorageModule',
  7. 'ngMaterial',
  8. 'ngMaterialDatePicker',
  9. 'appSdk'
  10. ]);
  11. app.config(['$stateProvider', '$urlRouterProvider',
  12. function($stateProvider, $urlRouterProvider) {
  13. $stateProvider.state('home', {
  14. url:'/groups?group',
  15. reloadOnSearch: false,
  16. templateUrl:'views/home.html',
  17. controller:'HomeController'
  18. });
  19. $stateProvider.state('rooms', {
  20. url:'/rooms?group',
  21. reloadOnSearch: false,
  22. templateUrl:'views/home.html',
  23. controller:'HomeController'
  24. });
  25. $stateProvider.state('freeroom', {
  26. url:'/freeroom',
  27. templateUrl:'views/freeroom.html',
  28. controller:'FreeRoomController'
  29. });
  30. $urlRouterProvider.otherwise('/groups');
  31. }])
  32. .directive('dateNow', ['$filter', function($filter) {
  33. return {
  34. link: function( $scope, $element, $attrs) {
  35. $element.text($filter('date')(new Date(), $attrs.dateNow));
  36. }
  37. };
  38. }])
  39. .run(['$rootScope', '$state', 'DataShareBusiness', 'GroupsBusiness', 'StaffsBusiness', 'RoomsBusiness', '$mdDateLocale', '$filter',
  40. function ($rootScope, $state, DataShareBusiness, GroupsBusiness, StaffsBusiness, RoomsBusiness, $mdDateLocale, $filter) {
  41. var promiseLoadEntities = {
  42. id: "promiseLoadEntities",
  43. loaderGroups: ["toolbar"],
  44. groups: ["sidebar"]
  45. };
  46. GroupsBusiness.getAll(promiseLoadEntities).then(function(groups)
  47. {
  48. StaffsBusiness.getAll(promiseLoadEntities).then(function(staffs)
  49. {
  50. RoomsBusiness.getAll(promiseLoadEntities).then(function(rooms)
  51. {
  52. DataShareBusiness.Groups = groups;
  53. DataShareBusiness.Staffs = staffs;
  54. DataShareBusiness.Rooms = rooms;
  55. });
  56. });
  57. });
  58. $mdDateLocale.firstDayOfWeek = 1;
  59. $mdDateLocale.formatDate = function(date) {
  60. return $filter("date")(date, DataShareBusiness.DateFormat);
  61. };
  62. }]);