Advertisement
Guest User

Issue in spring-boot modular project

a guest
Feb 12th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. List of changed files in the modular https://github.com/spring-guides/tut-spring-security-and-angular-js/tree/master/modular project:
  2.  
  3. # static/js/home/home.html
  4. <h1>Welcome</h1>
  5. <div>
  6.     <p>Hello {{user}}!</p>
  7.     <p><a href="message/link_msg">Show message via URL</a>
  8. </div>
  9.  
  10. # static/js/message/message.js
  11. var msg = angular.module('message', []);
  12. msg.controller('message', function($scope, $http) {
  13.     $http.get('/resource/').success(function(data) {
  14.         $scope.greeting = data;
  15.     });
  16. });
  17.  
  18. msg.controller('messageWithRouteParam', ['$scope', '$routeParams', function($scope, $routeParams) {
  19.     $scope.greeting = {id: "no id", content: $routeParams.msg};
  20. }]);
  21.  
  22. # static/js/hello.js
  23. angular.module('hello', [ 'ngRoute', 'auth', 'home', 'message', 'navigation' ])
  24.         .config(
  25.  
  26.                 function($routeProvider, $httpProvider, $locationProvider) {
  27.  
  28.                     $locationProvider.html5Mode(true);
  29.  
  30.                     $routeProvider.when('/', {
  31.                         templateUrl : 'js/home/home.html',
  32.                         controller : 'home'
  33.                     }).when('/message', {
  34.                         templateUrl : 'js/message/message.html',
  35.                         controller : 'message'
  36.                     }).when('/message/:msg', {
  37.                         templateUrl : 'js/message/message.html',
  38.                         controller : 'messageWithRouteParam'
  39.                     }).when('/login', {
  40.                         templateUrl : 'js/navigation/login.html',
  41.                         controller : 'navigation'
  42.                     }).otherwise('/');
  43.  
  44.                     $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  45.  
  46.                 }).run(function(auth) {
  47.  
  48.             // Initialize auth module with the home page and login/logout path
  49.             // respectively
  50.             auth.init('/', '/login', '/logout');
  51.  
  52.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement