1

For some reason, I keep getting a 404 (cannot be found) for my wardrobes.html file. The other files work fine (such as login.html and cards.html).

I've read through documentation & examples- still cannot figure this one out.

Do I need to tell AngularJS to allow my HTML file? In the same dir, I've added a .js file to index.html which can be found

routes.js

angular.module('stashd.routes', [])

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

        $urlRouterProvider.otherwise("/login");

        $stateProvider

            .state('login', {
                url: '/login',
                views: {
                    'menuContent': {
                        templateUrl: 'app/core/login/login.html'
                    }
                },
                controller: function ($ionicHistory, $scope) {
                    console.log('Clearing history!');
                    $ionicHistory.nextViewOptions({
                        historyRoot: true,
                        disableBack: true
                    });
                }
            })

            .state('wardrobes', {
                url: '/wardrobes',
                views: {
                    'menuContent': {
                        templateUrl: 'app/components/wardrobes/wardrobes.html'
                    }
                },
            })
            //What does menuContent do?

            .state('cards', {
                url: '/',
                views: {
                    'menuContent': {
                        templateUrl: 'app/components/cards/cards.html'
                    }
                }
            });
    }
])

wardrobes.html

<ion-view name="wardrobes">
  <!-- The title of the ion-view will be shown on the navbar -->
  <ion-view view-title="wardrobes">
    <ion-content ng-controller="WardrobesCtrl">
      <!-- The content of the page -->
     <h1>This page working or not?!>
    </ion-content>
  </ion-view>
</ion-view>

Chrome console & directory of code

Chrome console & directory of code

2
  • try to upload to some js-sandbox, cos fix file placement mistakes is hard without it
    – FLCL
    Dec 15, 2015 at 14:02
  • Added to above. Thanks
    – Yian
    Dec 15, 2015 at 14:07

1 Answer 1

1

As you can see, you have mistake in name of the html file:

wardobes.html

in place of

wardrobes.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.