You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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', '$httpProvider', '$locationProvider',
  12. function($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) {
  13. //$locationProvider.html5Mode(true);
  14. $stateProvider.state('home',{
  15. url:'/',
  16. reloadOnSearch: false,
  17. templateUrl:'views/home.html',
  18. controller:'HomeController'
  19. });
  20. $stateProvider.state('freeroom',{
  21. url:'/freeroom',
  22. templateUrl:'views/freeroom.html',
  23. controller:'FreeRoomController'
  24. });
  25. $urlRouterProvider.otherwise('/');
  26. }])
  27. .directive('dateNow', ['$filter', function($filter) {
  28. return {
  29. link: function( $scope, $element, $attrs) {
  30. $element.text($filter('date')(new Date(), $attrs.dateNow));
  31. }
  32. };
  33. }])
  34. .run(['$rootScope', '$state', '$location', 'DataShareBusiness', 'GroupsBusiness', '$mdDateLocale', '$filter',
  35. function ($rootScope, $state, $location, DataShareBusiness, GroupsBusiness, $mdDateLocale, $filter) {
  36. var promiseLoadGroups = {
  37. id: "promiseLoadGroups",
  38. loaderGroups: ["toolbar"],
  39. groups: ["sidebar"]
  40. };
  41. GroupsBusiness.loadAll(promiseLoadGroups);
  42. $mdDateLocale.firstDayOfWeek = 1;
  43. $mdDateLocale.formatDate = function(date) {
  44. return $filter("date")(date, DataShareBusiness.DateFormat);
  45. };
  46. }]);