virtual-repeat: not rendering in md-sidenav
The virtual-repeat shows when the sidenav is initially rendered open, but if the sidenav is initially rendered closed, and opened programatically then the virtual-repeat does not not render.
A workaround is to call $(window).trigger('resize') after the first call to $mdSidenav('component-id').toggle()
Can reproduce that issue. I've created a little codepen which demonstrates the issue
- http://codepen.io/DevVersion/pen/jqObZa
@topherfangio Since our sidenav is hidden, since the directive compilation, the virtual repeater has no time to validate the layout. That's why we need to trigger a revalidation of the virtualRepeater's layout, when the sidenav is visible to the DOM.
I suggest, calling the resize handler, when the sidenav is opening. That will fix issues with components, which are watching the layout.
angular.element(window).triggerHandler('resize');
Thoughts?
For sidenav, this may be acceptable since it shouldn't happen very often, and there is generally only 1-2 sidenav's per app. But I think we need a more generic solution for other components that may depend on the visibility/size of other components. I have a $mdResize service in the works that needs a bit more work here: https://github.com/profoundry-us/material/tree/fix-show-hide-protractor-performance-7159
Still broken per your June 18th comment above; I will implement an async callback, build the model and template dynamically, then inject into side <md-sidenav>'s <md-content> directive, and then post the example for this semi "fixed" framework work around. Hang tight, answer is on the way...
@joehoeller if you are still seeing a bug related to this, please open a new issue with a CodePen reproduction and link to this issue as a reference.