Guest User

Untitled

a guest
Oct 21st, 2019
1,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import Html exposing (..)
  2. import Html.Attributes exposing ( class, id )
  3.  
  4.  
  5. type alias User =
  6. { firstName: String
  7. , lastName: String
  8. }
  9.  
  10. users =
  11. [ { firstName = "John", lastName = "Smith" }
  12. , { firstName = "Jane", lastName = "Johnson" }
  13. ]
  14.  
  15. userItem user =
  16. li []
  17. [ span [ class "firstName" ] [ text user.firstName ]
  18. , br [] []
  19. , span [ class "lastName" ] [ text user.lastName ]
  20. ]
  21.  
  22. main =
  23. div [ id "my-component" ]
  24. [ ul [] (List.map userItem users) ]
Advertisement
Add Comment
Please, Sign In to add comment