I am new to playframework 2, and I would like to iterate over the card in the template, I am using java at the moment :-) Can someone please write an example? My map is similar:
Map<Integer,MyObject>
Thank you in advance
In the Play 2 template, you can iterate on a map using this syntax:
@(myMap: Map[Integer, MyObject]) @for((key, value) <- myMap){ @key - @value }
Thanks so much for your answer @mguillermin. I found another that might help someone use the current index in a loop:
@for(((key, value), currentIndex) <- myMap.zipWithIndex) { @key - @value - @currentIndex }
Source: https://habr.com/ru/post/1483884/More articles:Getting started with gcutil and Compute Engine: Error: Resource projects / not found - osx-snow-leopardHTML Select an event to change events on a scroll bar in Chrome if the select tag has a size attribute - javascriptIs it normal / recommended to have id holes in my user table (rails 3.2 / postgresql) - ruby-on-railsSlow scroll background (parallax) - javascriptParallax vertical scroll effect - javascriptReading in integer from stdin in python - pythonEcho content inside foreach only once - phphttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1483887/using-python-ctypes-to-pass-struct-pointer-to-a-dll-function&usg=ALkJrhhefcB-OCIoWp09oQrTK3HC4Nu6xARails 4 and RSpec, the undefined `` assertions '' method in the routing specification - ruby-on-rails-4Firefox sdk - content script cannot access self.port - javascriptAll Articles