1
1
MEANS.js
2
2
=============
3
- Type-safe Scala.js Bindings for the MEAN Stack (MongoDB ExpressJS AngularJS NodeJS).
3
+ MEANS.js is a Scala.js Facade for the MEAN Stack (MongoDB ExpressJS AngularJS NodeJS).
4
4
5
- Table of Contents
5
+ ## Table of Contents
6
6
7
7
* <a href =" #Introduction " >Introduction</a >
8
8
* <a href =" #Development " >Development</a >
@@ -21,8 +21,11 @@ Table of Contents
21
21
<a name =" Introduction " ></a >
22
22
## Introduction
23
23
24
- The goal of MEANS.js is to be complete set of type-safe Scala.js bindings for the entire MEAN Stack + Scala.js.
25
- MEANS.js goes to great lengths to make all the things you love about writing Scala on the MEAN Stack.
24
+ The goal of MEANS.js is to be a complete Scala.js facade for the entire MEAN Stack. Why? Because I love NodeJS,
25
+ but I have a love/hate relationship with JavaScript. And many others feel the same way about JavaScript, which is why
26
+ there are so many languages that are designed to improve the experience (CoffeeScript, TypeScript, Scala.js and others).
27
+ Simply put, MEANS.js let's me have my cake and eat it too! And as such, I've gone to great lengths to bring all the
28
+ things you love about developing applications on the MEAN Stack to Scala.
26
29
27
30
<a name =" Development " ></a >
28
31
## Development
@@ -457,8 +460,8 @@ Consider the following example:
457
460
458
461
``` scala
459
462
$http.get[js.Dynamic ](" /api/tradingClock/status" ) onComplete {
460
- case Success (obj ) => console.log(angular.toJson(obj ))
461
- case Failure (e) => ...
463
+ case Success (status ) => console.log(angular.toJson(status ))
464
+ case Failure (e) => console.error(e.getMessage)
462
465
}
463
466
```
464
467
@@ -473,10 +476,11 @@ However, sometimes we instead want to retrieve the data as a type-safe Scala obj
473
476
474
477
``` scala
475
478
$http.get[MarketStatus ](" /api/tradingClock/status" ) onComplete {
476
- case Success (status) => ...
477
- case Failure (e) => ...
479
+ case Success (status) => console.log(angular.toJson(status))
480
+ case Failure (e) => console.error(e.getMessage)
478
481
}
479
482
483
+ @ js.native
480
484
trait MarketStatus extends js.Object {
481
485
var stateChanged : Boolean = js.native
482
486
var active : Boolean = js.native
0 commit comments