Answer by gpresland for AngularJS routing without the hash '#'
In Angular 6, with your router you can use:RouterModule.forRoot(routes, { useHash: false })
View ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer by skeep for AngularJS routing without the hash '#'
try $locationProvider.html5Mode(true)More info at $locationProviderUsing $location
View ArticleAngularJS 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