Open Kennedy-s opened 7 years ago
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
The type signature for update
in Html.beginnerProgram
is Msg -> Model -> Model
, not Msg -> Model -> (Model, Cmd Msg)
. If you are wanting to use commands as part of your update you may want to try using Html.program
.
Thanks a lot Devjason it's working now
I am having a problem creating a login form and am getting along that mismatch problem and this are my codes am using
import Html.Attributes exposing (..) import Html exposing (..) import Http import Svg exposing (..)
main = Html.beginnerProgram { model = model , view = view , update = update }
-- Model
type alias Model = { username : String , password : String , login : String }
model : Model model = { username = "" , password = "" , login = "" }
-- Update
type Msg = Username String | Password String | Login String
update msg model = case msg of login -> ( model, Cmd.none)
-- View view : Model -> Html Msg view model = Html.form [ id "login-form" ] [ Html.h1 [] [ Html.text "Sensational Login Form" ] , Html.label [ for "username-filed" ] [ Html.text "username" ] , input [ id "username-filed" , type "text" , value model.username ] [] , label [ for "passwortd-field"] [ Html.text "password: " ] , input [ id "password-field" , type "password" , value model.password ] [] , div [ class "login-button" ] [ Html.text "Log In" ] ]
-- Subscriptions