I tried to put SideMenu
into ionic
1, but it did not work. On the main screen a list was appearing and I tried to put a SideMenu
, but now it is only showing header-bar
, follow print: link
can anybody help me? Or give some hint of what I did wrong in creating SideMenu
?
routes.js
angular.module('starter')
.config(function($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise('principal');
$stateProvider
.state('app', {
url: '/app',
templateUrl : 'templates/menu.html',
abstract: true
})
.state('app.principal', {
url: '/principal',
views : {
'menuContent' : {
templateUrl: 'templates/principal.html',
controller: 'PrincipalController'
}
}
})
.state('app.eventoescolhido', {
url: '/eventoescolhido/:evento',
views: {
'menuContent' : {
templateUrl: 'templates/eventoescolhido.html',
controller: 'EventoEscolhidoController'
}
}
})
})
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link rel="manifest" href="manifest.json">
<!-- un-comment this code to enable service worker
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
}
</script>-->
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controller.js"></script>
<script src="js/routes.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view>
<ion-nav-bar class="bar bar-assertive">
</ion-nav-bar>
</ion-nav-view>
</body>
</html>
menu.html
<ion-side-menus>
<ion-side-menu-content>
<ion-nav-bar>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="center"></button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"> </ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-content>
teste
</ion-content>
</ion-side-menu>
</ion-side-menus>