Navigation through pages in an application on Ionic does not work. In the view folder put the file qwe.html with the following content: qweqwe In app.js wrote this

 .config(function($stateProvider,$urlRouterProvider){ $stateProvider .state('index',{ url:'/', abstract:true, templateUrl:'index.html' }) .state('index.qwe',{ url:'/view/qwe', views:{ 'qwe':{ templateUrl:'view/qwe.html' } } }); }) 

In index.html this is written:

 <body ng-controller="main"> <ion-pane> <ion-header-bar class="bar-stable"> <a href="#/">index</a> <a href="#/view/qwe">qwe</a> </ion-header-bar> <ion-content> <ng-view></ng-view> </ion-content> <div class="bar bar-footer bar-balanced"> </div> </ion-pane> </body> 

It seems that everything is done as in the numerous documentation on Ionic and Angular, but when you click on the links on the screen, nothing changes. Only the address bar changes. The console on the Network tab shows that the qwe.html file is found. I tried to add 'ngRoute' models to the ad and connect angular-route.js - the outcome is the same. What could be wrong?

  • What kind of router is used? if built-in angulyarovskiy - where did the steith come from? if ui-router, where does the ng-view directive come from? - Grundy
  • I just sat down yesterday for Aionik and Angulyar and do not understand much. Thoughts are confused not only in the head but also in the code, so if you know exactly where my mistake is, please explain. I practically have no idea why I wrote it there) - Al Mr
  • replace ng-view with ui-view. And instead of mindlessly copying everything from somewhere, you should at least look at an example of the same ionic - Grundy
  • replaced and little has changed. I would say nothing has changed - Al Mr

1 answer 1

Earned when I wrote states in app.js like this

 .state('qwe',{ url:'/qwe', templateUrl:'view/qwe.html' }) 

At index.html wrote the directive <ion-nav-view></ion-nav-view>