Right now, I am guessing your Tab.view has this signature:
Tab.view : Tab.Model -> List (Html Tab.Msg) -> Html Tab.Msg
Try changing it to follow this signature:
Tab.view : (Tab.Msg -> a) -> Tab.Model -> List (Html a) -> Html a
And your Main.view will then look like this:
view model =
Tab.view TabMsg model.tabModel
[ App.map LogsMsg <| LogList.view model.logModel ]
The other solution that comes to mind would be to nest the LogList.Model
within Tab.Model and nest LogList.Msg within Tab.Msg, but I am guessing you
want the Tab component to be more generic than that.
On Tue, May 17, 2016 at 3:26 AM, Luis Fei <[email protected]> wrote:
> Hi, I was trying to upgrade from 0.16 to 0.17, and meet this problem
>
> I have a Main.view which contains a Tab.view, and Tab.view contains a
> LogList.view, so i change the Signal.forwardTo part like this:
>
> -- This is Main module
>
> type alias Model =
> { tabModel : Tab.Model
> , logsModel : LogList.Model
> }
>
> type Msg
> = TabMsg Tab.Msg
> | LogMsg LogList.Msg
>
> view : Model -> Html Msg
> view model =
> App.map TabMsg
> <| Tab.view model.tabModel
> [ App.map LogsMsg <| LogList.view model.logModel ]
>
>
> And the compiler complained as the Tab.view is expecting `List (Html
> Tab.Msg)` but it is `List (Html Msg)`, I understand why the compiler
> complain like this, the problem is I don't know how to do these kind of
> multi-level nesting.
>
> thanks.
>
> BTW, I read
> https://github.com/evancz/elm-architecture-tutorial/blob/master/nesting/2-counter-list.elm,
> but it's single child to parent communication.
>
> --
> 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.
>
--
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.