Hi,
New to ionic. Trying to build android app that has 4 pages. each page has a button that links it to next page. First page is loaded by default and a button in it opens d 2nd page. but nothing’s getting loaded in d the page is blank. find the code below.
app.js
angular.module(‘starter’, [‘ionic’, ‘starter.controllers’, ‘starter.services’])
.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.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
})
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('page1', {
url: "/page1",
templateUrl: "templates/page1.html",
controller: 'MainCtrl' })
.state('page2', {
url: "/page2",
templateUrl: 'templates/page2.html',
controller: 'ConsultCtrl' });
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise(’/page1’);
});
index.html
<body ng-app="starter">
ion-pane>
// bootstrap header here
ion-nav-view> /ion-nav-view>
/ion-pane>
controllers.js
angular.module(‘starter.controllers’, [])
.controller(‘MainCtrl’, function($scope, $state) {})
.controller(‘ConsultCtrl’, function($scope) {});
page1.html
ion-view view-title=“consult time”>
ion-content>
a href="#/page2" type=“button” class=“bot-button btn btn-success btn-block marginTop”>SCHEDULE A CONSULTATION</a
/ion-content>
/ion-view>
PS: Removed < from tags so it doesn’t render d html, html code not complete, only necessary info provided.