Preety Sapra
Preety Sapra

Reputation: 615

ionic routing issue with ionic framwork, it is sowing blank page?

I started building ionic app, and I want to change the views, I am not using tag, I have separate file for every view.

The states look like this:

var route = angular.module('route', []);

route.config(function($stateProvider, $urlRouterProvider) {
     $stateProvider
    .state('home', {
      url: '/home',
      abstract: true,
      templateUrl: 'home.html',
    })
    .state('login', {
      url: '/login',
      templateUrl: 'login.html'
    })
    .state('register', {
      url: '/register',
      templateUrl: 'register.html'
    })
    .state('manage-booking', {
      url: '/manage-booking',
      templateUrl: 'manage_booking.html'
    })
    .state('clinic-list', {
      url: '/clinic-list',
      templateUrl: 'clinic_list.html'
    })

    $urlRouterProvider.otherwise('/home');
});

When I run the app, the url defaults to '/#/home'

I am not able to figure out why is it not loading the home page. When I change the otherwise to point to '/#/login', everything works.

Upvotes: 1

Views: 65

Answers (1)

Mati Tucci
Mati Tucci

Reputation: 2976

Remove the abstract: true property (source)

Upvotes: 2

Related Questions