Closed gerfen closed 5 years ago
I was able to hack around this issue by making a change to the underlying materialize-css tabs.js code -- basically checking if there are any tabs before trying to set the active
css class to the first <li/>
tag, adding a reference to aurelia-async-binding along with adding & async
where appropriate to my bindings in my view and calling tabs.refresh() after my data is returned from my REST call in my view model. It's an ugly hack IMO but it's got me moving forward. I would still like to get some advice on a better approach.
@gerfen
Does adding an element that wraps your <ul>
tabs element with if.bind="locations.length"
work?
<div if.bind="locations.length">
<ul md-tabs ...>
</ul>
</div>
I'm creating tabs from a collection which is being retrieved from an async REST call. My markup looks like this:
The tabs fail to render with the following error:
The code in materialize.js looks like this:
If I click back and forth on a navbar in my application the tabs will eventually render correctly. Any ideas on what I might try to get the tabs to render when my
locations
collection is returned from my REST call?