0

I try change build-in Angular route mechanism to ui.router. So I included angular.ui.router.js to my index.html and to my module:

var app = angular.module('multibookWeb', ['ui.router']);

Next I set routing in app.config:

$urlRouterProvider.otherwise('/list');
    $stateProvider
        .state('list', {
            url: '/list',
            templateUrl: '/partials/list/list.html',
        });

Console don't show any errors, but routing doesn't work. I fired www.someAddress.com/# and I expect that my routing redirects me to www.someAddress.com/#/list or something like this. Unfortunately it doesn't happend. When I console (inside $watch) value of $state.current.name it return me empty string. I tried debugging by this, but console is still empty...

My Angular version: 1.2.28

My Ui.router version: 0.2.13

Here is plunker

Community
  • 1
  • 1
kubut
  • 315
  • 5
  • 16

1 Answers1

1

The problem is, you have no ui-view.

For the ui-router to function you will need an ui-view. Replace your ng-view with ui-view and it will work.

Jonathan
  • 3,614
  • 3
  • 21
  • 30