0

I have a rails app with dashboard page. So the page will be http://mywebsite.com/dashboard. It has few links available which will load pages via ajax and show it in a div section inside the dashboard page. Its all working fine. So lets assume I want to use angular here and I specify code like below.

  var myapp = angular.module('myapp', ["ui.router"])
    myapp.config(function($stateProvider, $urlRouterProvider){



      $stateProvider
        .state('route1', {
            url: "/route1",
            templateUrl: "route1.html"
        })

    })

My doubt is that:

So in here if dashboard is the root url then the url generated is http://mywebsite.com/#route1

What if my dashboard page is defined like this

http://mywebsite.com/dashboard and I want to define route like http://mywebsite.com/dashboard/#route1

Note: Its not a single page application. But I want the dashboard page to be like a single page one..

1 Answer 1

1

This will work fine and the route will be relative to your URL http://mywebsite.com/dashboard.

If you were using HTML5 mode with Angular UI router if you try and interoperate the full URL. But because you are not using HTML5 mode, Angular UI router routes using #.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.