Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openmole
gate
Commits
69475dc0
Commit
69475dc0
authored
Aug 07, 2014
by
Mathieu leclaire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get case class from the server
parent
1f3c1a88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
Client.scala
client/src/main/scala/fr/iscpif/client/Client.scala
+4
-3
MyScalatraServlet.scala
server/src/main/scala/fr/iscpif/app/MyScalatraServlet.scala
+1
-1
Shared.scala
shared/Shared.scala
+3
-2
No files found.
client/src/main/scala/fr/iscpif/client/Client.scala
View file @
69475dc0
...
@@ -37,16 +37,17 @@ object Client {
...
@@ -37,16 +37,17 @@ object Client {
val
submitButton2
=
button
(
"Click me"
)(
val
submitButton2
=
button
(
"Click me"
)(
cursor
:=
"pointer"
,
cursor
:=
"pointer"
,
onclick
:=
{
()
=>
onclick
:=
{
()
=>
Post
[
Api
](
_
.
caseClass
(
MyCaseClass
(
"Hello !"
))
).
foreach
{
s
=>
Post
[
Api
](
_
.
caseClass
).
foreach
{
s
=>
caseClassValue
()
=
s
caseClassValue
()
=
s
.
hello
}
}
false
false
}
}
).
render
).
render
Rx
{
dom
.
document
.
body
.
appendChild
(
submitButton1
)
dom
.
document
.
body
.
appendChild
(
submitButton1
)
dom
.
document
.
body
.
appendChild
(
submitButton2
)
dom
.
document
.
body
.
appendChild
(
submitButton2
)
Rx
{
dom
.
document
.
body
.
appendChild
(
h1
(
helloValue
).
render
)
dom
.
document
.
body
.
appendChild
(
h1
(
helloValue
).
render
)
dom
.
document
.
body
.
appendChild
(
h1
(
caseClassValue
).
render
)
dom
.
document
.
body
.
appendChild
(
h1
(
caseClassValue
).
render
)
}
}
...
...
server/src/main/scala/fr/iscpif/app/MyScalatraServlet.scala
View file @
69475dc0
...
@@ -11,7 +11,7 @@ import scala.concurrent.Await
...
@@ -11,7 +11,7 @@ import scala.concurrent.Await
object
Server
extends
Api
{
object
Server
extends
Api
{
def
hello
(
a
:
Int
)
=
a
*
3
def
hello
(
a
:
Int
)
=
a
*
3
def
caseClass
(
c
:
MyCaseClass
)
=
c
.
oo
def
caseClass
=
MyCaseClass
(
"Hello !"
)
}
}
class
MyScalatraServlet
extends
ServertestStack
{
class
MyScalatraServlet
extends
ServertestStack
{
...
...
shared/Shared.scala
View file @
69475dc0
...
@@ -5,12 +5,13 @@ import scala.scalajs.js.annotation.JSExport
...
@@ -5,12 +5,13 @@ import scala.scalajs.js.annotation.JSExport
class
Web
extends
ClassfileAnnotation
class
Web
extends
ClassfileAnnotation
@Web
@JSExport
@JSExport
case
class
MyCaseClass
(
o
o
:
String
)
case
class
MyCaseClass
(
hell
o
:
String
)
@Web
@Web
trait
Api
{
trait
Api
{
def
hello
(
a
:
Int
)
:
Int
def
hello
(
a
:
Int
)
:
Int
def
caseClass
(
cc
:
MyCaseClass
)
:
String
def
caseClass
(
)
:
MyCaseClass
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment