javascript - How do I get my ionic side menu button working? -


I have recently tried to create an Ionic side menu. I had a problem when I swipe the main body and then open the menu. But I stopped the swipe function and now I can not open the menu. I want to be able to click on the Navy icon to be able to open the menu, but do not know how to do it.

Here's the JavaScript:

  .controller ('TodoCtrl', function ($ scope, $ timeout, $ ionicModal, projects, $ ionicSideMenuDelegate ) {$ Scope.toggleLeft = function () {$ ionicSideMenuDelegate.toggleLeft ();};  

Here is the header code which is the button:

  & lt; body ng-app = "TODO" ng controller = "TodoCtrl" & gt; & lt; ion side menu & gt; & lt ;! - center content - & gt; & lt; ion Side menu content & gt; & lt; ion header bar class = "bar-dark" & gt; button class = "button button-icon button clean ion navicon" ng-click = "toggl ELeft () "& gt; & lt; / button & gt; & lt; h1 class =" title "& gt; {{activeProject.title}} & lt; / h1 & gt; & lt ;! - New task button - & gt; button class = "button button-icon" ng-click = "newTask ()" & gt; & lt; i class = "type icon ion" & gt; & lt; / i & gt; ; & Lt; / button & gt; & lt; / ion-header-bar & gt; & lt; ion-content scrolls = "wrong" & gt; & lt; td-cards class = "theLabel" id = "card "Ng-repeat =" work in active.project.tasks "& gt; & Lt; Td-card class = "card - {{card.index}}" & gt; & Lt; H4 style = "text-align: center" & gt; {{Task.title}} & lt; / H4 & gt; & Lt; / TD-Card & gt; & Lt; / TD-Card & gt;  

Here is the menu content:

  & lt; Ion side menu side = "left" & gt; & Lt; Ion-pen ion-side-menu-content drag-content = "wrong" & gt; & Lt; Ion-header-bar class = "bar-dark" & gt; & Lt; H1 class = "title" & gt; Card & lt; / H1> & Lt; / Ion header bar & gt; & Lt; Ion-content scroll = "true" & gt; & Lt; Edge-drag-threshold = "true" drag-content = "true" & gt; & Lt; / Ion content & gt; & Lt; / Ion panel & gt; & Lt; / Ion side menu & gt;  

An easy to use ionic menu-toggle Instructions so you can toggle the menu on a button like this.

  & lt; Ion-header-bar class = "bar-dark" & gt; & Lt; Button class = "button button-icon button-clear ion-navy" menu-toggle = "left" & gt; & Lt; / Button & gt; & Lt; H1 class = "title" & gt; {{ActiveProject.title}} & lt; / H1> & Lt ;! - New task button - & gt; & Lt; Button class = "button button-mark" ng-click = "new task ()" & gt; & Lt; I class = "icon ion-creation" & gt; & Lt; / I & gt; & Lt; / Button & gt; & Lt; / Ion header bar & gt;  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -