0

I was reading this question and wanted to change it a little so what i enter in home's input field will be shown in the other

I tried bind the input with {{name}} but don't know how to put it in the line below

<a ui-sref="home({foo: 'Foo,mojtaba1', bar: 'barVal1'})">home({foo: 'Foo,mojtaba1', bar: 'barVal1'})</a>

here is a plunker

Also added var name = $stateParams.name; in .controller

So the question is how to pass the input name from page home to other with url and also show it?

Community
  • 1
  • 1
Mojtaba
  • 713
  • 4
  • 10
  • 25

1 Answers1

1

You could then add new parameter in your state definition & then pass that parameter in ui-sref directive, so that will take care href url creation

ui-sref="home({foo: 'Foo,mojtaba1', bar: 'barVal1', name: name})"
Pankaj Parkar
  • 130,886
  • 22
  • 223
  • 289