Skip to content

Commit

Permalink
Refactor angularjs maven archetype to support html5 uris
Browse files Browse the repository at this point in the history
  • Loading branch information
jogep committed May 1, 2015
1 parent e3682f9 commit f150c9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
<head>
<meta charset="utf-8">
<title>My AngularJS Struts2 App</title>

<s:url var="ctxUrl" forceAddSchemeHostAndPort="true" includeContext="true" value="/" namespace="/" ></s:url>
<base href="<s:property value="ctxUrl"/>">
</head>
<body>

<h2><s:property value="message"/></h2>

<div>
<a href="#/home">Home</a> - <a href="#/projects">Projects</a>
<a href="/home">Home</a> - <a href="/projects">Projects</a>
</div>

<div ng-controller="AppController">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit f150c9f

Please sign in to comment.