doubt with json

Asked

Viewed 47 times

-2

I have a json, in my form I have a button "Proximo" and "Anterior", I need to create a code that shows the next or previous record, as I click the buttons, I am using angular, someone could give a hint of how this code could be ?

json

[{
    "Type": "Debito",
    "Date": "01/11/2016",
    "TransactionValue": 371.6,
    "Id": "388354",
    "Description": "ENVIO TEV",
    "Checksum": 388354,
    "lancado": "Não"
}, {
    "Type": "Debito",
    "Date": "01/11/2016",
    "TransactionValue": 148.0,
    "Id": "389749",
    "Description": "ENVIO TEV",
    "Checksum": 389749,
    "lancado": "Não"
}, {
    "Type": "Debito",
    "Date": "04/11 /2016 ",
    "TransactionValue ": 508.2,
    "Id ": "33531 ",
    "Description ": "PAG BOLETO ",
    "Checksum ": "33531",
    "lancado ": "Não "
}]

I couldn’t adjust json Aki, Aki has an image inserir a descrição da imagem aqui

  • Got some code ready ?

  • What does this json look like? Put this json and the code you already have

  • I made an ng-prepeat creates several Ivs, when I click on a div, it opens a screen with the data of the record, in this same screen, I want to create a button forward and back, not having to close the screen and click on another div

  • Dude, if you use routes you can use an Angular Breadcrumb that’s pretty cool

1 answer

0


In the controller you arrow the atual = 0

Suppose your list is in a variable called registros

<div class="local_exibicao_dados">{{registros[atual]}}</div>


<a ng-click="atual--" ng-show="atual > 0">Anterior</a>
{{atual}}
<a ng-click="atual++" ng-show="atual < registros.length">Próximo</a>

Browser other questions tagged

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