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?

2
  • in which parameter you wanted to pass name parameter? Commented May 17, 2016 at 10:02
  • it could be a new parameter along side of foo and bar Commented May 17, 2016 at 10:04

1 Answer 1

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})"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.