Shouldn't that be Html.map, not Html.Attributes.map? itemView returns a Html
msg, not an Html.Attribute msg...
On Saturday, 22 April 2017 21:53:47 UTC-4, Erik Lott wrote:
>
> view : Model -> Html Msg
> view model =
> div []
> (model.items
> |> List.map itemView
> |> List.map (Html.Attributes.map ItemMsg)
> )
>
>
>
>
> On Saturday, April 22, 2017 at 5:25:41 PM UTC-4, Vardhan wrote:
>>
>> [ Pardon if this appear twice ]
>>
>> hi,
>> this is my toy 1st elm app.
>> i'm trying to keep the 'item' of the list as a seperet module.
>>
>> so i have in module Item:
>> ---------------------------------
>> type alias ItemModel= { ... }
>> type ItemMsg = .. | .. | ..
>> itemView : ItemModel -> Html ItemMsg
>> ---------------------------------
>>
>> And in the top level App module:
>> -----------------------------------------
>> type alias Model = { items: List ItemModel }
>> type Msg = ItemMsg ItemMsg | ...
>> view : Model -> Html Msg
>> view model =
>> div []
>> (List.map itemView model.items )
>> ------------------------------------------
>>
>> Well, the problem is itemView can't be used , as it is 'Html ItemMsg',
>> and not 'Html Msg'
>> However, the Item module doesn't have access to 'Msg' ( which is top
>> level ),
>>
>> How should I use itemView in the view function ?
>>
>> -Regards
>> Vardhan
>>
>>
>>
--
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.