main.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Password Management Servlets (PWM)
  3. * http://www.pwm-project.org
  4. *
  5. * Copyright (c) 2006-2009 Novell, Inc.
  6. * Copyright (c) 2009-2021 The PWM Project
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. */
  20. import 'angular';
  21. import 'angular-translate';
  22. import 'angular-sanitize';
  23. import '@microfocus/ng-ias/dist/ng-ias';
  24. // Add a polyfill for Set() for IE11, since it's used in peoplesearch-base.component.ts
  25. import 'core-js/es/set';
  26. import { bootstrap, module } from 'angular';
  27. import helpDeskModule from './helpdesk.module';
  28. import PeopleService from '../../services/people.service';
  29. import PwmService from '../../services/pwm.service';
  30. import routes from './routes';
  31. import TranslationsLoaderFactory from '../../services/translations-loader.factory';
  32. import uiRouter from '@uirouter/angularjs';
  33. import HelpDeskConfigService from '../../services/helpdesk-config.service';
  34. import HelpDeskService from '../../services/helpdesk.service';
  35. import PasswordService from '../../services/password.service';
  36. module('app', [
  37. uiRouter,
  38. helpDeskModule,
  39. 'pascalprecht.translate',
  40. 'ng-ias'
  41. ])
  42. .config(routes)
  43. .config([
  44. '$translateProvider',
  45. ($translateProvider: angular.translate.ITranslateProvider) => {
  46. $translateProvider
  47. .translations('fallback', require('../../i18n/translations_en.json'))
  48. .useLoader('translationsLoader')
  49. .useSanitizeValueStrategy('escapeParameters')
  50. .preferredLanguage('en')
  51. .fallbackLanguage('fallback')
  52. .forceAsyncReload(true);
  53. }])
  54. .service('HelpDeskService', HelpDeskService)
  55. .service('PasswordService', PasswordService)
  56. .service('PeopleService', PeopleService)
  57. .service('PwmService', PwmService)
  58. .service('ConfigService', HelpDeskConfigService)
  59. .factory('translationsLoader', TranslationsLoaderFactory);
  60. // Attach to the page document, wait for PWM to load first
  61. window['PWM_GLOBAL'].startupFunctions.push(() => {
  62. bootstrap(document, ['app'], { strictDi: true });
  63. });