1

This might not even be possible, but I'm going to try anyway. In my website I have a couple of states defined with ui-router. One of these states should link to another domain. Is this possible?

$stateProvider
  .state('index', {
    url: "/index",
    templateUrl: "views/home.html",
    controller: "MainController",
    ncyBreadcrumb: {
        label: 'Home'
    }
  })
  .state('about', {
    url: "/about",
    templateUrl: "views/about.html",
    controller: "AboutController",
    ncyBreadcrumb: {
        label: 'About',
        parent: 'index'
    }
  })
  .state('Us', {
    url: "/us",
    parent: "about",
    views : {
      '@': {
        templateUrl: 'views/us.html',
      },
    }
  })
  .when('contact', 'http://www.example.com')

1 Answer 1

3

UI router is handling internal application URL's. anyway you can achieve using script redirection.

$stateProvider.state('contact', {
     url: '/',
     template: 'Redirecting...<script>window.location="http://www.example.com"</script>'
});
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.