I'm injecting a Elm feature to an existing page written by PHP.
The data responded from server for an item has url : "this-is-detail-link.html"
and I need to get the host name to concat with the url.
For example:
case Msg of
GoToDetailPage item ->
let
hostname = getHostNameFromElm // <- how can I get this?
// expected: http://example.com/this-is-detail-link.html
fullUrl =
Url.Builder.crossOrigin hostname item.url []
cmd =
Browser.Navigation.load fullUrl
in
(model, cmd)
I am using Browser.element
main =
Browser.element
{ init = init
, view = view
, update = update
, subscriptions = subscriptions
}
Try to search but not what I expect. It requires to use Browser.application, not a part like this. Any suggestion? Thanks in advance!