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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -