angular - Ionic 3 - Side menu , change side dynamically -


i want change direction of side menu automatically when change language (rtl , ltr) tried code in page app.html

<ion-menu [side]="isrtl?'right':'left'" [content]="content"> 

how can change value of 'isrtl' page or example "home.ts" ?

'isrtl' declared in 'app.component.ts' guys ?

use event emitor cross component transfer data between components

//home component.ts import { events } 'ionic-angular';  constructor(public events: events) {} directiochange(user) {this.events.publish('directiochanged', 'true');}   //app.component.ts constructor(public events: events) { events.subscribe('directiochanged', (direction) => { this.isrtl = direction;console.log(direction);});} 

not home component, can set anywhere in project


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -