>From what I understand doesn't $locationProvider.html5Mode(true); remove
the hash from your URL? While it does that for me only the home page seems
to be ok when you refresh the page. Isn't that what redirectTo: supposed to
handle?
They're solutions on stackOverFlow, (augmenting .htacess files etc. )but
don't seem so clear. Can someone help with specifics?
var rustyApp = angular.module('rustyApp', ['ngRoute','viewController',
'mm.foundation','angular-flexslider','ui.router'],
function($routeProvider, $locationProvider) {
$routeProvider.when('/', {
templateUrl: '/partials/home.html',
controller: 'HomeController'
});
// When you put /home, it also automatically handles /home/ as well
$routeProvider.when('/work', {
templateUrl: '/partials/work.html',
controller: 'WorkController'
});
$routeProvider.when('/contact', {
templateUrl: '/partials/contact.html',
controller: 'ContactController'
});
$routeProvider.otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true).hashPrefix('!');
});
//This is in my head of the index.html file
<base href="/"/>
//And this is the navigation
<section class="top-bar-section uk-navbar-flip">
<ul class="uk-navbar-nav ">
<li my-active-link="/"><a href="/"><i class="uk-icon-home
uk-icon-medium "> </i>home</a></li>
<li my-active-link="/#work"><a href="/#work"><i class="uk-icon-photo
uk-icon-medium "></i> work</a></li>
<li my-active-link="/#contact"><a href="/#contact"><i
class="uk-icon-envelope-o uk-icon-medium "></i> contact</a>
</ul>
</section>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.