ember-cli-materialize icon indicating copy to clipboard operation
ember-cli-materialize copied to clipboard

Tabs with Link-tos

Open clov3r opened this issue 9 years ago • 3 comments

Best way to use the md-tabs component as a navigation item?

Something like:

  {{#md-tabs}}
    {{#md-tab}}
      {{link-to "Demographics" "dashboard.facilities.show.index" model}}
    {{/md-tab}}
    {{#md-tab}}
      {{link-to "Documents" "dashboard.facilities.show.documents" model}}
    {{/md-tab}}
    {{#md-tab}}
      {{link-to "Credentialing" "dashboard.facilities.show.credentialing" model}}
    {{/md-tab}}
    {{#md-tab}}
      {{link-to "Lodging" "dashboard.facilities.show.lodging" model}}
    {{/md-tab}}
    {{#md-tab}}
      {{link-to "Jobs" "dashboard.facilities.show.jobs" model}}
    {{/md-tab}}
    {{#md-tab}}
      {{link-to "Providers" "dashboard.facilities.show.providers" model}}
    {{/md-tab}}
    {{#md-tab}}
      {{link-to "Activity" "dashboard.facilities.show.activity" model}}
    {{/md-tab}}
    {{#md-tab}}
      {{link-to "Upcoming" "dashboard.facilities.show.upcoming" model}}
    {{/md-tab}}
  {{/md-tabs}}

clov3r avatar Sep 09 '15 13:09 clov3r

I would suggest binding to the "active" tab (selected attribute of md-tabs) to a computed property, and putting a transitionTo in the setter.

We should really have an action binding on the set of tabs for on-change or something, but that doesn't currently exist.

mike-north avatar Sep 09 '15 16:09 mike-north

I for one would also prefer a built-in solution for this, because this is a really common use case. :+1:

floqqi avatar Sep 11 '15 13:09 floqqi

as common of a use case as this is, it's difficult to figure out an idiomatic way to allow components to be aware of router state without using private APIs (i.e., the same stuff Ember.LinkToComponent uses)

mike-north avatar Sep 11 '15 18:09 mike-north