I'm having trouble transitioning to another view state when I only have the full URL path. The ui-router says to use $state.transitionTo or $state.go but those require the state name.
I tried to change the current URL using $location.url(path) but nothing happens.
Is $location.url(path) the correct way, and something is wrong with my setup or is there another way to do it?
Here is my configuration for the home page:
$stateProvider.state( { name: 'home', url: '^/', templateUrl: "/home.html" } ); Here is my config for the app.
cgTag.App.Config.Config = function($httpProvider, $locationProvider, $sce) { // Let CakePHP see $http requests as AJAX $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // use HTML5 non-hash URLs $locationProvider.html5Mode(true); $locationProvider.hashPrefix('!'); // add all the CDN domains to the white list so that URLs are not blocked by Angular. var cdn = cgTag.AppData["Domain"].replace(/^www\./, "http://s*.") + "/**"; $sce.resourceUrlWhitelist(['self', cdn]); }; cgTag.Angular.config(['$httpProvider', '$locationProvider', '$sceDelegateProvider', cgTag.App.Config.Config]); If the current browser url is http://www.cgtag.com/movies then calling $location.url("/") should go to the home page, but nothing happens.
$urlRouterProviderand$stateProvierand the URL you are trying to navigate to?