Quantcast
Channel: AngularJS routing without the hash '#' - Stack Overflow
Browsing all 11 articles
Browse latest View live

Answer by gpresland for AngularJS routing without the hash '#'

In Angular 6, with your router you can use:RouterModule.forRoot(routes, { useHash: false })

View Article



Answer by Mahendra Waykos for AngularJS routing without the hash '#'

**It is recommended to use the HTML 5 style (PathLocationStrategy) as location strategy in Angular**BecauseIt produces the clean and SEO Friendly URLs that are easier forusers to understand and...

View Article

Image may be NSFW.
Clik here to view.

Answer by georgeawg for AngularJS routing without the hash '#'

Using HTML5 mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html). Requiring a <base> tag is also important...

View Article

Answer by Gharibi for AngularJS routing without the hash '#'

You could also use the below code to redirect to the main page (home):{ path: '', redirectTo: 'home', pathMatch: 'full'}After specifying your redirect as above, you can redirect the other pages, for...

View Article

Answer by zero_cool for AngularJS routing without the hash '#'

The following information is from:https://scotch.io/quick-tips/pretty-urls-in-angularjs-removing-the-hashtagIt is very easy to get clean URLs and remove the hashtag from the URL in Angular.By default,...

View Article


Answer by vijay for AngularJS routing without the hash '#'

Lets write answer that looks simple and shortIn Router at end add html5Mode(true);app.config(function($routeProvider,$locationProvider) { $routeProvider.when('/home', { templateUrl:'/html/home.html'...

View Article

Answer by Mister P for AngularJS routing without the hash '#'

If you are wanting to configure this locally on OS X 10.8 serving Angular with Apache then you might find the following in your .htaccess file helps:<IfModule mod_rewrite.c> Options...

View Article

Answer by bearfriend for AngularJS routing without the hash '#'

If you enabled html5mode as others have said, and create an .htaccess file with the following contents (adjust for your needs):RewriteEngine OnRewriteBase /RewriteCond %{REQUEST_URI}...

View Article


Answer by plus- for AngularJS routing without the hash '#'

In fact you need the # (hashtag) for non HTML5 browsers.Otherwise they will just do an HTTP call to the server at the mentioned href.The # is an old browser shortcircuit which doesn't fire the request,...

View Article


Answer by skeep for AngularJS routing without the hash '#'

try $locationProvider.html5Mode(true)More info at $locationProviderUsing $location

View Article

AngularJS routing without the hash '#'

I'm learning AngularJS and there's one thing that really annoys me.I use $routeProvider to declare routing rules for my application:$routeProvider.when('/test', { controller: TestCtrl, templateUrl:...

View Article
Browsing all 11 articles
Browse latest View live




Latest Images