Skip to content

Instantly share code, notes, and snippets.

@nojaf
Created September 25, 2017 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nojaf/23342b8e11bb73818c87220e3b6eb001 to your computer and use it in GitHub Desktop.
Save nojaf/23342b8e11bb73818c87220e3b6eb001 to your computer and use it in GitHub Desktop.
Fable I
open System
open Fable.Core
open Fable.Core.JsInterop
open Fable.Import
type App() =
member this.ChangeColor selector color =
let element = Browser.document.querySelector selector :?> Browser.HTMLElement
element.style.color <- color
Browser.window.addEventListener_load (fun ev ->
let app = App()
app.ChangeColor "h1" "emerald" :> obj
)
printfn "works!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment