I have ionic-modal template scripts in another separate HTML file and calling those from ProductCtrl by $ionicModal.fromTemplateUrl (script_id)
Here is my code,
$stateProvider
.state('app.product', {
url: "/products",
views: {
'menuContent@app': {
controller: 'ProductCtrl',
templateUrl: "js/product/templates/product.html"
}
}
})
Product.html
<ion-view view-title='Products'>
<ion-header-bar></ion-header-bar>
<ion-content></ion-content>
</ion-view>
Product-Modals.html
<script id="modal_1.html" type="text/ng-template">...</script>
<script id="modal_2.html" type="text/ng-template">...</script>
<script id="modal_3.html" type="text/ng-template">...</script>
<script id="modal_4.html" type="text/ng-template">...</script>
Controller ProductCtrl
.controller('ProductCtrl', function($scope, $ionicModal){
$ionicModal.fromTemplateUrl('modal_1.html', {
scope: $scope,
animation: 'slide-in-right'
}).then(function (modal) {
$scope.modal_1 = modal;
});
$ionicModal.fromTemplateUrl('modal_2.html', {
scope: $scope,
animation: 'slide-in-right'
}).then(function (modal) {
$scope.modal_2= modal;
});
$ionicModal.fromTemplateUrl('modal_3.html', {
scope: $scope,
animation: 'slide-in-right'
}).then(function (modal) {
$scope.modal_3= modal;
});
I am getting 404 error
- GET http://localhost:8100/modal_1.html 404 (Not Found)
- GET http://localhost:8100/modal_2.html 404 (Not Found)
- GET http://localhost:8100/modal_3.html 404 (Not Found)
is there any way to do this...?