Skip to content

How do I pass an expression to ui-sref? #745

Closed
@gigablox

Description

@gigablox

Let's say I need dynamic ui-sref

<div ng-repeat="panel in panels">
  <a ui-sref="panel.state" class="thumbnail">
    <h2>{{ panel.name}}</h2>
  </a>
</div>

Where my panels look like:

{
  name:'Contact General',
  state:'contact.general'
},
{
  name:'Contact Other',
  state:'contact.other'
}

Is it possible to pass the object property into the ui-sref directive?
From the docs it seems like it only accepts strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions