您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

app.js 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. 'use strict';
  2. /* App Module */
  3. angular.module('app', [
  4. 'ui.bootstrap',
  5. 'ui.router',
  6. 'LocalStorageModule',
  7. 'ngMaterial',
  8. 'dialogs.main',
  9. 'luticateAuth',
  10. 'luticateUtils',
  11. 'appSdk'
  12. ])
  13. .config(['$stateProvider', '$urlRouterProvider', '$compileProvider',
  14. function($stateProvider, $urlRouterProvider, $compileProvider) {
  15. $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|data):/);
  16. $stateProvider.state('root', {
  17. abstract: true,
  18. template: '<div ui-view=""></div>',
  19. resolve: ['luticateAuthUsers', function(luticateAuthUsers)
  20. {
  21. return luticateAuthUsers.loadUserData(null);
  22. }]
  23. });
  24. $stateProvider.state('home', {
  25. url:'/',
  26. parent: 'root',
  27. title: "Home",
  28. reloadOnSearch: false,
  29. templateUrl:'views/home.html',
  30. controller:'HomeController'
  31. });
  32. $stateProvider.state('login', {
  33. url:'/login',
  34. parent: 'root',
  35. title: "Login",
  36. reloadOnSearch: false,
  37. templateUrl:'views/login.html',
  38. controller:'LoginController'
  39. });
  40. $stateProvider.state('signUp', {
  41. url:'/signUp',
  42. parent: 'root',
  43. title: "Sign Up",
  44. reloadOnSearch: false,
  45. templateUrl:'views/signup.html',
  46. controller:'SignUpController'
  47. });
  48. $stateProvider.state('upload', {
  49. url:'/upload',
  50. parent: 'root',
  51. title: "Upload",
  52. reloadOnSearch: false,
  53. templateUrl:'views/upload.html',
  54. controller:'UploadController'
  55. });
  56. $urlRouterProvider.otherwise('/');
  57. }])
  58. .directive('dateNow', ['$filter', function($filter) {
  59. return {
  60. link: function( $scope, $element, $attrs) {
  61. $element.text($filter('date')(new Date(), $attrs.dateNow));
  62. }
  63. };
  64. }])
  65. .run(['$rootScope', '$state',
  66. function ($rootScope, $state) {
  67. $rootScope.$on('$stateChangeSuccess', function (event, current, previous) {
  68. $rootScope.title = current.title + " - 420px";
  69. });
  70. }]).filter("toDataUrl", function() {
  71. return function (data) {
  72. return "data:image/*;base64," + btoa(data);
  73. }
  74. });