2016-06-16 3 views
5

नहीं दिखा रहा है मैं रिक्त आयनिक 2 टेम्पलेट में 'burger' menu जोड़ने के लिए संघर्ष कर रहा हूं। निश्चित नहीं है कि यहां क्या गलत कर रहा है लेकिन मैंने जो कुछ किया है वह एक खाली आयनिक टेम्पलेट उत्पन्न करता है, टेम्पलेट स्ट्रिंग को टेम्पलेट यूआरएल में ऐप.ट्स में बदलें और ऐप.html में कोड पेस्ट करें। मुझे कोई कंसोल त्रुटियां नहीं मिल रही हैं।मेनू घटक

app.ts:

import {Component} from '@angular/core'; 
import {Platform, ionicBootstrap} from 'ionic-angular'; 
import {StatusBar} from 'ionic-native'; 
import {HomePage} from './pages/home/home'; 


@Component({ 
    templateUrl: 'build/app.html' 
}) 
export class MyApp { 
    rootPage: any = HomePage; 

    constructor(platform: Platform) { 
    platform.ready().then(() => { 
     // Okay, so the platform is ready and our plugins are available. 
     // Here you can do any higher level native things you might need. 
     StatusBar.styleDefault(); 
    }); 
    } 
} 

ionicBootstrap(MyApp); 

app.html:

<ion-menu [content]="content"> 
    <ion-toolbar> 
     <ion-title>Pages</ion-title> 
    </ion-toolbar> 
    <ion-content> 
     <ion-list> 
      <button ion-item (click)="openPage(loginPage)"> 
       Login 
      </button> 
      <button ion-item (click)="openPage(signupPage)"> 
       Signup 
      </button> 
     </ion-list> 
    </ion-content> 
</ion-menu> 
<ion-nav [root]="rootPage"></ion-nav> 

उत्तर

3

मैं home.html से बटन

<button right menuToggle> 
    <ion-icon name="menu"></ion-icon> 
    </button> 

याद आ रही थी

<ion-navbar *navbar> 
    <ion-title> 
    Blank Starter 
    </ion-title> 
    <button right menuToggle> 
    <ion-icon name="menu"></ion-icon> 
    </button> 
</ion-navbar> 

<ion-content class="home"> 
    <h1 text-center>Content goes here!</h1> 
</ion-content>