I am trying to add parameters to ui-sref. If I try this it works perfectly
<a ui-sref="services.test({ id: 2 , other_id: 3 })">test</a>
But If I try this it don't work
<a ui-sref="services.test({ id: firstexmple , other_id: secondone })">test</a>
If you try to set the
id
to literal value "firstexample" andother_id
to "secondone" you need to write them as you would write strings in plain JavaScript code, so:(mind that you can't use double quotes (like this
id: "firstexmple"
) because you're already using them as to wrap the wholeui-sref
attribute's value.