{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/material2/issues/1543","repository_url":"https://api.github.com/repos/angular/material2","labels_url":"https://api.github.com/repos/angular/material2/issues/1543/labels{/name}","comments_url":"https://api.github.com/repos/angular/material2/issues/1543/comments","events_url":"https://api.github.com/repos/angular/material2/issues/1543/events","html_url":"https://github.com/angular/material2/issues/1543","id":184177201,"number":1543,"title":"Sidenav - changing direction from ltr/rtl dynamically","user":{"login":"oyasovsky","id":7743973,"avatar_url":"https://avatars.githubusercontent.com/u/7743973?v=3","gravatar_id":"","url":"https://api.github.com/users/oyasovsky","html_url":"https://github.com/oyasovsky","followers_url":"https://api.github.com/users/oyasovsky/followers","following_url":"https://api.github.com/users/oyasovsky/following{/other_user}","gists_url":"https://api.github.com/users/oyasovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/oyasovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyasovsky/subscriptions","organizations_url":"https://api.github.com/users/oyasovsky/orgs","repos_url":"https://api.github.com/users/oyasovsky/repos","events_url":"https://api.github.com/users/oyasovsky/events{/privacy}","received_events_url":"https://api.github.com/users/oyasovsky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-20T09:22:16Z","updated_at":"2016-10-20T12:29:47Z","closed_at":"2016-10-20T12:29:47Z","body":"#### Bug, feature request, or proposal:\r\n\r\nTrying to change my layout dynamically according to users' language selection and switch from LTR to RTL on the fly.\r\n\r\nI'm using Angular 2 rc6, material 2.0.0-alpha.9-3\r\n\r\nIt looks like when the page is loaded, it works perfectly with either rtl or ltr. However, when it's changed dynamically from within the app (see plunker), the direction changes but the generated element md-sidenav-content has a miscalculated margin-right and margin-left.\r\n\r\nDigging further, I managed to see that the _dir object has an eventEmitter that should watch for on change events of _dir and recalculate the margins\r\n\r\n@angular/material/sidenav/sidenav.js:\r\n_dir.dirChange.subscribe(function () { return _this._validateDrawers(); });\r\n\r\nBut it's never called when changing the direction dynamically. Although, _dir holds the correct value when page is being loaded for the first time, whether its ltr or rtl.\r\n\r\nI've also tried importing Dir into my component and using its value in the view (instead the direction string that shows in my plunker) - to no avail. Everything is generated perfectly on the first time, but change event does not recalculate margins.\r\n\r\n#### What is the expected behavior?\r\n\r\n_dir.dirChange event is not called \r\n\r\n#### What is the current behavior?\r\n\r\n_dir.dirChange should be called, which will recalculate margins correctly\r\n\r\n#### What are the steps to reproduce?\r\n\r\nhttp://plnkr.co/edit/o8lXWC?p=preview\r\n\r\n"}}
{"actor":{"display_login":"oyasovsky"}}