Hi, can anyone help me to fix the problem with my code? Apparently the routing is not working. I put the js and html section of the code which is related here.
app.config (function($stateProvider, $urlRouterProvider) {
$stateProvider
.state(‘home’, {
url: “/home”,
abstract: true,
templateUrl: “templates/home.html”,
controller: ‘homeCtrl’
})
.state(‘question1’, {
url: ‘/question1’,
templateurl: ‘templates/question1.html’,
controller: ‘question1Ctrl’
});
$urlRouterProvider.otherwise("/tab/home");
})
HTML:
<ion-nav-bar class="bar-positive">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<ion-header-bar class="bar-stable">
<h1 class="title">Field Study</h1></br>
</ion-header-bar>
<ion-nav-view></ion-nav-view>
<script id="templates/home.html" type="text/ng-template" ng-controller="homeCtrl">
<ion-view view-title="Home">
asdfasdf
<ion-content class="padding">
{{locationSelect}}
<div class="list" ng-show="locationSelect">
<label class="item item-input item-select">
<div class="input-label">
Please select your location:
</div>
<!-- <select id="locationSelect" ng-model="placeAt.name" ng-click="goTourl('/question1')" href="javascript:void(0);">
<option ng-repeat="place in places" value="{{place.name}}">{{place.name}}</option>
<option value="false" selected>none of these</option>
</select> -->
<a class="button icon icon-right ion-chevron-right" ng-click="goTourl('/question1')" href="javascript:void(0);">Home1 </a>
</label>
</div>
</ion-content>
</ion-view>
</script>
<script id="templates/question1.html" type="text/ng-template">
<ion-view view-title="Question">
<ion-content class="padding">
{{getQuestion()}}
<div class="list" ng-show="questionavailable">
<div class="item item-text-wrap item-divider">
<h2 class="title">{{qScript}}</h2>
</div>
<div class="range item">
very uncomfortable
<input ng-model="placeAt.comfortlevel" min="1" max="7" value="3" type="range" name="comfortLevel">
very comfortable
</div>
<button class="button button-royal button-block" ng-click="sendQuestionResponse()">
{{submitbutton}}<i class="icon ion-thumbsup" ng-show="answerstored"></i>
</button>
</ion-content>
</ion-view>
</script>
Thank you in advance.