Good morning, Srs.,
How can I pass data from an item that has been selected within a ng-repeat list to another view?
Here is the code from the first view:
<div ng-repeat="jogador in dadosjogador | filter:{xid:equipe.jogador}" >
<div class="item-avatar item-button-right">
<img src="img/user1.jpg">
<h2>{{jogador.nome}}</h2>
<form action="voto.html" class="urna">
<input type="submit" value="Votar" />
</form>
</div>
</div>
Below is the code from the second view:
<body ng-app="starter" ng-controller="equipecontrol">
<ion-header-bar class="bar-calm" align-title="center">
<button class="button button-icon icon ion-ios-arrow-back ng" ng-click="goback()"></button>
<h1 class="title">{{jogador.nome}}</h1>
<button class="button button-icon icon ion-navicon" ></button>
</ion-header-bar>
</body>
In this second view I used {{jogador.nome}}
but the player name is not displayed.
I have tried to use a $rootScope._nomejogador
variable, I declare the same in the controller equipecontrol, which is common to both views, but I also do not know how to do: $rootScope._nomejogador = {{jogador.nome}}
the moment the item is selected and call the other view. / p>
Someone would have an idea how I can resolve this issue