Right here, you're saying that the UpdateModel type takes a String:

> type Msg = UpdateModel String
>
> update: Msg -> String -> String
> update action model =
>   case action of
>     UpdateModel newModel ->
>       newModel
>
> view: String -> Html a
> view model =
>   div[]
>   [
>     input[type' "text", placeholder "Please enter a name..."][]
>

But over here, you're not providing UpdateModel with a string:

>    ,button [onClick UpdateModel][text "Ajouter"]
>    ,div[][text model]
>   ]
>

The "onClick" event is just a did-it-happen event, it provides no
additional information. So the type system is detecting that there's a
mismatch. Try replacing your `view` function with this:

view : String -> Html Msg
> view model =
>     div []
>         [ input [ type' "text", placeholder "Please enter a name..." ] []
>         , button [ onClick (UpdateModel "Ajouter") ] [ text "Ajouter" ]
>         , div [] [ text model ]
>         ]

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to