HI
I am trying to use nested views , but getting some javascript error like:
Uncaught TypeError: Cannot call method ‘insertBefore’ of null : ionic-bundle:10255
I am trying to make a OrderPage with 2 subpages:
ordermedicine.html:
<ion-view name="selectstore">
</ion-view>
<ion-view name="patientdetails">
</ion-view>
statemanagement:
.state('order', {
url: '/order',
abstract: true,
templateUrl: 'partials/ordermedicine.html',
controller: 'OrderMedicineCtrl'
})
.state('order.selectstore', {
url: '/selectstore',
views: {
'selectstore': {
templateUrl: "partials/order_selectstore.html",
controller: 'OrderMedicineCtrl'
}
}
})
.state('order.patientdetails', {
url: '/patientdetails',
views: {
'patientdetails': {
templateUrl: "partials/order_patientdetails.html",
controller: 'OrderMedicineCtrl'
}
}
})
Controller:
.controller('OrderMedicineCtrl', function($scope, $state) {
$scope.patientdetails = function() {
console.log('patientdetails');
$state.go('order.patientdetails');
};
$scope.medicinedetails = function() {
console.log('medicinedetails');
$state.go('order.medicinedetails');
};
$scope.deliverydetails = function() {
console.log('deliverydetails');
$state.go('order.deliverydetails');
};
$scope.confirmorder = function() {
console.log('confirmorder');
$state.go('order.confirmorder');
};
})
order_selectstore.html
<ion-view title="Select Store">
<ion-content>
<a class="button icon-right ion-chevron-right button-calm" ng-click="patientdetails()">Enter Patient Details</a>
</ion-content>
</ion-view>
order_pateintdetails.html
<ion-view title="Patient Details">
<ion-content>
<a class="button icon-right ion-chevron-right button-calm" ng-click="medicinedetails()">Enter Medicine Details</a>
</ion-content>
</ion-view>
The same nested states concept however works for Tabbing. Am I missing anything basic here?
