Click here to Skip to main content
15,878,231 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi there sorry for this newbie question, I have recently discovered ionic, cordova, angular js and I understand the concept of how the navigation works. but I am having trouble to set my login page as my start page, the url shows /login but only the header bar shows (without text) which I think is shown from the index page. I am using the defualt tabs template.

<body ng-app="starter">
      The nav bar that will be updated as we navigate between views.
    <ion-nav-bar class="bar-stable">
      The views will be rendered in the <ion-nav-view> directive below
      Templates are in the /templates folder (but you could also
      have templates inline in this html file if you'd like).
    <ion-nav-view class="slide-left-right"></ion-nav-view>

<ion-view view-title="Login" name="login-view">
  <ion-content class="padding">
     <div class="list">
         <label class="item item-input">
              <span class="input-label">Username</span>
              <input type="text">
         <label class="item item-input">
              <span class="input-label">Password</span>
              <input type="password">
      <button class="button button-block button-calm" ng-click="login()">Login</button>


angular.module('starter', ['ionic', 'starter.controllers', ''])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required

.config(function($stateProvider, $urlRouterProvider) {

  // Ionic uses AngularUI Router which uses the concept of states
  // Learn more here:
  // Set up the various states which the app can be in.
  // Each state's controller can be found in controllers.js

  // setup an abstract state for the tabs directive
    .state('tab', {
    url: "/tab",
    abstract: true,
    templateUrl: "templates/tabs.html"

  // Each tab has its own nav history stack:

.state('tab.login', {
    url: '/login',
    views: {
      'login': {
        templateUrl: 'templates/login.html',
        controller: 'loginCtrl'

  .state('tab.dash', {
    url: '/dash',
    views: {
      'tab-dash': {
        templateUrl: 'templates/tab-dash.html',
        controller: 'DashCtrl'

  .state('tab.projects', {
      url: '/projects',
      views: {
        'tab-projects': {
          templateUrl: 'templates/tab-projects.html',
          controller: 'projectsCtrl'
    .state('tab.projects-detail', {
      url: '/projects/:projectsId',
      views: {
        'tab-projects': {
          templateUrl: 'templates/projects-detail.html',
          controller: 'projectsDetailCtrl'

  .state('tab.account', {
    url: '/account',
    views: {
      'tab-account': {
        templateUrl: 'templates/tab-account.html',
        controller: 'AccountCtrl'

  // if none of the above states are matched, use this as the fallback



angular.module('starter.controllers', [])

.controller('loginCtrl', function($scope) {})

.controller('DashCtrl', function($scope) {})

.controller('projectsCtrl', function($scope, Chats) {
  $scope.chats = Chats.all();
  $scope.remove = function(chat) {

.controller('ChatDetailCtrl', function($scope, $stateParams, Chats) {
  $ = Chats.get($stateParams.chatId);

.controller('AccountCtrl', function($scope) {
  $scope.settings = {
    enableFriends: true

thanks in advance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900