app.js 768 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. angular
  3. .module('app', [
  4. 'ngComponentRouter',
  5. 'angularMoment',
  6. 'ngMaterial',
  7. 'ngSanitize',
  8. 'api.cms.ufmg'
  9. ])
  10. .value('$routerRootComponent', 'app')
  11. .config(($locationProvider) => {
  12. $locationProvider.html5Mode(true);
  13. })
  14. .run((amMoment) => {
  15. amMoment.changeLocale('pt-br');
  16. })
  17. .component('app', {
  18. templateUrl: 'app.component.html',
  19. controller: ['$scope', '$location', 'cms', ($scope, $location, cms) => {
  20. cms.Authenticated().then(
  21. _ => { $location.path("/a/dashboard"); },
  22. _ => { $location.path("/signin"); }
  23. );
  24. }],
  25. $routeConfig: [
  26. { path: '/a/...', name: 'Main', component: 'main' },
  27. { path: '/signin', name: 'Signin', component: 'signin' },
  28. ]
  29. });