0

I'm trying to get an input from user and pass it to second page named other

added a new parameter in state definition called test

You can check the code here

the other looks like this

<li><a ui-sref="other">#/other/fooVal</a></li>

If i try to change it like belowe it just get disabled

<li><a ui-sref="other{{test: 'test1'">#/other/fooVal</a></li>

What should id do to show user input in other page

PS: the other sref works fine

1 Answer 1

1

<a ui-sref="other{{test: 'test1'">#/other/fooVal</a>

should be

<a ui-sref="other({test: 'test1'})">#/other/fooVal</a>

Note how it's an object in parenthesis ({ }), not an expression block {{ }}.

Sign up to request clarification or add additional context in comments.

4 Comments

it disables it again.you wrote the syntax right but it's not for here.you can check it.
@Mojtaba What do you mean by "it's not for here"? I tested it on your example, it works fine.
thank you.it solved part of the problem but i'm still unable to show the typed message in the 'other' page.
I think the issue there is that you have different scopes that aren't available to each other.

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.