{"id":560,"date":"2017-07-02T11:53:28","date_gmt":"2017-07-02T09:53:28","guid":{"rendered":"http:\/\/blog.via-internet.de\/?p=560"},"modified":"2017-07-02T11:53:28","modified_gmt":"2017-07-02T09:53:28","slug":"ionic-app-from-scratch-two-sidemenus","status":"publish","type":"post","link":"https:\/\/via-internet.de\/blog\/2017\/07\/02\/ionic-app-from-scratch-two-sidemenus\/","title":{"rendered":"Ionic | App from Scratch &#8211; Two Sidemenus"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Prepare your starter App<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ionic start App sidemenu --type angular --no-git<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change into the newly create folder and start the Ionic App<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd App\nionic serve<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You will see the default Ionic Sidemenu App<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1864\" height=\"1456\" src=\"https:\/\/i0.wp.com\/blog.via-internet.de\/wp-content\/uploads\/2019\/12\/Bildschirmfoto-2019-12-20-um-11.19.29.png?fit=700%2C547\" alt=\"\" class=\"wp-image-5349\" srcset=\"https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2019\/12\/Bildschirmfoto-2019-12-20-um-11.19.29.png 1864w, https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2019\/12\/Bildschirmfoto-2019-12-20-um-11.19.29-300x234.png 300w, https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2019\/12\/Bildschirmfoto-2019-12-20-um-11.19.29-1024x800.png 1024w, https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2019\/12\/Bildschirmfoto-2019-12-20-um-11.19.29-768x600.png 768w, https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2019\/12\/Bildschirmfoto-2019-12-20-um-11.19.29-1536x1200.png 1536w\" sizes=\"auto, (max-width: 1864px) 100vw, 1864px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The entries of the sSidemenu are defined in app.components.ts:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">export class AppComponent {\n\tpublic appPages = [\n\t\t{ title: 'Home', url: '\/home', icon: 'home' },\n\t\t{ title: 'List', url: '\/list', icon: 'list' }\n\t];<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The sidemenu itself and his apperance are defined in app.component.html:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"13,14\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;ion-app>\n  &lt;ion-split-pane contentId=\"main-content\">\n    &lt;ion-menu contentId=\"main-content\" type=\"overlay\">\n      &lt;ion-header>\n        &lt;ion-toolbar>\n          &lt;ion-title>Menu&lt;\/ion-title>\n        &lt;\/ion-toolbar>\n      &lt;\/ion-header>\n      &lt;ion-content>\n        &lt;ion-list>\n          &lt;ion-menu-toggle auto-hide=\"false\" *ngFor=\"let p of appPages\">\n            &lt;ion-item [routerDirection]=\"'root'\" [routerLink]=\"[p.url]\">\n              &lt;ion-icon slot=\"start\" [name]=\"p.icon\">&lt;\/ion-icon>\n              &lt;ion-label>{{p.title}}&lt;\/ion-label>\n            &lt;\/ion-item>\n          &lt;\/ion-menu-toggle>\n        &lt;\/ion-list>\n      &lt;\/ion-content>\n    &lt;\/ion-menu>\n    &lt;ion-router-outlet id=\"main-content\">&lt;\/ion-router-outlet>\n  &lt;\/ion-split-pane>\n&lt;\/ion-app><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The Sidemenu entries and the Icon are added in line 13 and 14 to the sidemenu.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Define two sidemenus in app.html<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;ion-menu [content]=\"contentLeft\"> ....&lt;\/ion-menu>\n&lt;ion-menu side=\"right\" [content]=\"contentRight\">....&lt;\/ion-menu>\n ....\n\n&lt;ion-nav [root]=\"rootPage\" #contentLeft #contentRight swipeBackEnabled=\"false\">&lt;\/ion-nav><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Add buttons to page<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;ion-header>\n   &lt;ion-navbar>\n      &lt;button ion-button start menuToggle>\n         &lt;ion-icon name=\"menu\">&lt;\/ion-icon>\n      &lt;\/button>\n      &lt;ion-title>Demo of two Sidemenus&lt;\/ion-title>\n      &lt;button ion-button end menuToggle=\"right\">\n         &lt;ion-iconname=\"menu\">&lt;\/ion-icon>\n      &lt;\/button>\n   &lt;\/ion-navbar>\n&lt;\/ion-header>\n&lt;ion-content padding>\n&lt;\/ion-content><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Result<\/h5>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"60\" src=\"http:\/\/blog.via-internet.de\/wp-content\/uploads\/2017\/07\/Bildschirmfoto-2017-07-02-um-11.47.14-300x60.png\" alt=\"\" class=\"wp-image-562\" srcset=\"https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2017\/07\/Bildschirmfoto-2017-07-02-um-11.47.14-300x60.png 300w, https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2017\/07\/Bildschirmfoto-2017-07-02-um-11.47.14-1024x205.png 1024w, https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2017\/07\/Bildschirmfoto-2017-07-02-um-11.47.14-768x154.png 768w, https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2017\/07\/Bildschirmfoto-2017-07-02-um-11.47.14.png 1100w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">Github Repository<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can find the code <a href=\"https:\/\/github.com\/ionic-toolbox\/app_from_scratch_with_sidemenu_left_and_right\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prepare your starter App Change into the newly create folder and start the Ionic App You will see the default Ionic Sidemenu App The entries of the sSidemenu are defined in app.components.ts: The sidemenu itself and his apperance are defined in app.component.html: The Sidemenu entries and the Icon are added in line 13 and 14 to the sidemenu. Define two sidemenus in app.html Add buttons to page Result Github Repository You can find the code here<\/p>\n","protected":false},"author":1,"featured_media":241,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[98,34,35],"tags":[],"class_list":["post-560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ionic","category-ionic-3","category-ionic-4"],"jetpack_featured_media_url":"https:\/\/via-internet.de\/blog\/wp-content\/uploads\/2016\/11\/Bildschirmfoto-2016-11-28-um-06.12.34-e1481363320900.png","jetpack_sharing_enabled":false,"_links":{"self":[{"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/posts\/560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/comments?post=560"}],"version-history":[{"count":0,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/posts\/560\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/media\/241"}],"wp:attachment":[{"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/media?parent=560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/categories?post=560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/via-internet.de\/blog\/wp-json\/wp\/v2\/tags?post=560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}