You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.
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.
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
The text was updated successfully, but these errors were encountered: