Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Html exposing (..)
- import Html.Attributes exposing ( class, id )
- type alias User =
- { firstName: String
- , lastName: String
- }
- users =
- [ { firstName = "John", lastName = "Smith" }
- , { firstName = "Jane", lastName = "Johnson" }
- ]
- userItem user =
- li []
- [ span [ class "firstName" ] [ text user.firstName ]
- , br [] []
- , span [ class "lastName" ] [ text user.lastName ]
- ]
- main =
- div [ id "my-component" ]
- [ ul [] (List.map userItem users) ]
Advertisement
Add Comment
Please, Sign In to add comment