angulate2
angulate2 copied to clipboard
Generalize Data annotation
Case classes annotated with @Data should be translated into plain JS objects when compiled with Scala.js (and be ignored with Scala/JVM).
Example: when Node is defined as
@Data
case class Node(id: Int, label: Option[String] = None, children: Seq[Node] = Nil)
then
Node(1, label = Some("root"), children = Seq(
Node(2, label = Some("child1")),
Node(3)
))
should translate to
{id: 1, label: "root", children: [{id: 2, label: "child1", children: []}, {id: 3, label: undefined, children: []}]}