pass selected input from one hmtl to another

Asked

Viewed 38 times

0

Good afternoon Gentlemen.,

I have a collection that is already visible by two distinct html’s in my app, however in the first html I go through the collection through an ng-repeat and when I select a particular item from this list, I invoke the second html to present only this item that was selected. So, what I need is: Move the number of the item that was selected in the first html to the second html. How do I do this? I’ve tried $rootScope, but I had trouble using $apply() that says it’s already in use.

  • Create a service for this with get/set functions

  • @Diegoaugusto, good morning! I already have a service that shoots a file and then I set the collection through a controller that reads the return of this file, but for get, which will be necessary in the second html, I need to inform which item will be recovered in this get, this is my problem. You have to present an example of how I could do this?

  • You have tried to store the reference of the Dice in a second variable and use $Scope (if it is in the same controller) or $rootScope to inform the second html which element it should recover?

  • @Even using a $rootScope variable to store the data, this is not shown in the second html. I tried using $Scope. $apply() then the system causes an error stating that $apply() is already in use.

  • Apply is reserved word if I’m not mistaken, try another variable name

  • @Paz I didn’t declare Apply, I used $Scope. $apply() to update the contents of the variables that were changed.

  • Any new ideas?

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.