Sidenav doesn't show on partial view
When I change view (ng-view) using partials, the sidenav inside my partial view doesn't get toggled (both 'on' and 'off' won't work) unless I reload the whole page.
Any idea?
Code is pretty simple: got a sidenav in the main layout (which currently has no issues) and various (depends on the partial, between 1 and 2) other sidenavs which need a click on a button (with a call on a $scope function) to get toggled.
Can you open a plunkr with a reproduce case?
Aye, here it is:
http://plnkr.co/F2q4nCgloqnIX7gJjkTL
You might need to wait some seconds to see the full view due to heavy scripts inclusions (angular-animate, angulat-route, etc.)
+1 for this issue. Seems that $mdComponentRegistry doesn't check for duplicates on register step. And it returns wrong instance of sidenav when partial view loads again.
Good catch @crrrazymind.
The component registry is very old, and was only meant to be a proof of concept. It will be refactored soon.
For now, I would advise using data-binding to open and close your sidenav.
Nice to know what it's about.
@ajoslin What do you mean by "data-binding" to open and close the sidenav?
Use the is-open attribute. It's in the API documentation for sidenav.
Thank you for explanation, your suggestion works perfectly.