How can I have the following format of URL www.domain.com/#pageName ?

20 views
Skip to first unread message

Fulvio Cosco

unread,
May 29, 2015, 7:54:02 AM5/29/15
to ang...@googlegroups.com
Hello to everybody, as I wrote in the title I was wondering if there is some way to have that kind of url "www.domain.com/#pageName"
I need to display the '#' symbol before the name of the page in that format " /# ". 
I tried to set the routes like "/#page" o put <base href="/"> and routes like "/page" putting <base href="/#">

Can someone explain to me how can I "fix" that?


Armando Couto - Gmail

unread,
May 29, 2015, 7:59:45 AM5/29/15
to ang...@googlegroups.com
Fly can use the standard html5


--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Att
Armando Couto 
CSM - LKU

Fulvio Cosco

unread,
May 29, 2015, 8:15:03 AM5/29/15
to ang...@googlegroups.com
Sorry? I'm new with AngularJs.

Robert STAICU

unread,
May 29, 2015, 8:18:34 AM5/29/15
to ang...@googlegroups.com
I personally use ui.router(you can search it on google) and use states.
var modules      = ['ui.router'],
    dependencies = [];
angular
  .module('table', modules)
  .config(function($stateProvider){ 
    $stateProvider
      .state('home',{
        url:'/',
        views:{
          'example':{
            template: '<p>In here we will have our table</p>'
          }
        }
      })
      .state('page', {
        url: "/pageName",
        views:{
          'example':{
            templateUrl: "/templates/page"
          }
        }
      })
}).controller('MyCtrl', ['$state', function($state){$state.go('page')}])


If you go on state page your url will look like www.your-domain.com/#/pageName

I hope this helps. Also original url should be www.your-domain.com/ to have /#/pageName. 

Have a good day

Fulvio Cosco

unread,
May 29, 2015, 9:14:09 AM5/29/15
to ang...@googlegroups.com
Yes, it's a really good patch, but I wanted find a way to do that by Angular routeProvider.
Thanks you so much.

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/36wUjRT9wN4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages