I am trying to add a control to enable and disable the subscription in the elm time example. . The problem is that I cannot force html and svg to coexist in the view.
So far I have this for presentation:
import Html exposing (Html) import Html.App as Html import Html.Attributes exposing (..) import Html.Events exposing (..) import Svg exposing (..) import Svg.Attributes exposing (..) import Time exposing (Time, second) -- MODEL, UPDATE and SUBSCRIPTION removed for brevity -- VIEW view : Model -> Html Msg view model = Html.div [] [ Html.p [] [ text "hello world" ] , clock ] clock : Model -> Html msg clock model = let angle = turns (Time.inMinutes model.time) handX = toString (50 + 40 * cos angle) handY = toString (50 + 40 * sin angle) in svg [ viewBox "0 0 100 100", Svg.Attributes.width "300px" ] [ circle [ cx "50", cy "50", r "45", fill "#0B79CE" ] [] , line [ x1 "50", y1 "50", x2 handX, y2 handY, stroke "#023963" ] [] ]
However, I get the following message when I try to overlap:
Detected errors in 1 module. ==================================== ERRORS ====================================
In addition to fixing the error, is there a way to fix the problem of not having to add Html to all html elements? e.g. Html.div as opposed to a regular div .
source share