File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/main/scala/tutorial/webapp Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 55 < title > The Scala.js Tutorial</ title >
66 </ head >
77 < body >
8+ < button id ="click-me-button " type ="button " onclick ="addClickedMessage() ">
9+ Click me!
10+ </ button >
11+
812 <!-- Include Scala.js compiled code -->
913 < script type ="text/javascript " src ="./target/scala-2.13/scala-js-tutorial-fastopt/main.js "> </ script >
1014 </ body >
Original file line number Diff line number Diff line change 11package tutorial .webapp
22
3+ import scala .scalajs .js .annotation .JSExportTopLevel
4+
35import org .scalajs .dom
46import org .scalajs .dom .document
57
@@ -13,4 +15,9 @@ object TutorialApp {
1315 parNode.textContent = text
1416 targetNode.appendChild(parNode)
1517 }
18+
19+ @ JSExportTopLevel (" addClickedMessage" )
20+ def addClickedMessage (): Unit = {
21+ appendPar(document.body, " You clicked the button!" )
22+ }
1623}
You can’t perform that action at this time.
0 commit comments