0
I tried to put the SideMenu
in the ionic
1, but, did not work. On the main screen was appearing a list and tried to put a SideMenu
, but now only the header-bar
, follow print : http://imgur.com/a/9kCFe
Could someone help me? Or give some hint of what I did wrong in creating the 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>
html menu.
<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>
Vii who has not created any controller for your menu, create, declare in your index and see if it solves.
– Ramos
Another thing, in your other. state your app.js has to declare the menu in the views:
– Ramos
views: { "side-menu21": { templateUrl: "templates/login/user/profile/enter_profile.html", controller: "login; }
– Ramos
@Ramos thanks so much for the help, I did not create controller as I was trying to follow an example of the sidemenu of the own Ionic I am comparing with it to see what I did wrong.
– Lucas Santos