From f150c9f295f41cbbddf122005c469dd7a935e233 Mon Sep 17 00:00:00 2001 From: Johannes Geppert Date: Fri, 1 May 2015 12:59:46 +0200 Subject: [PATCH] Refactor angularjs maven archetype to support html5 uris --- .../src/main/webapp/WEB-INF/content/hello.jsp | 5 ++++- .../archetype-resources/src/main/webapp/js/bootstrap.js | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/hello.jsp b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/hello.jsp index 703353eea..d66b06a13 100644 --- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/hello.jsp +++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/hello.jsp @@ -5,13 +5,16 @@ My AngularJS Struts2 App + + + ">

- Home - Projects + Home - Projects
diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/bootstrap.js b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/bootstrap.js index 501427fd4..beefd53ed 100644 --- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/bootstrap.js +++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/bootstrap.js @@ -21,8 +21,11 @@ var angularStrutsApp = angular.module('angularStrutsApp', ['ngRoute']); -angularStrutsApp.config(['$routeProvider', - function($routeProvider) { +angularStrutsApp.config(['$routeProvider', '$locationProvider', + function($routeProvider, $locationProvider) { + + $locationProvider.html5Mode(true).hashPrefix('!'); + $routeProvider.when('/projects', { templateUrl: 'partials/projects.html', controller: 'ApacheProjectsController'