You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,8 @@ Class-transformer allows you to transform plain object to some instance of class
12
12
Also it allows to serialize / deserialize object based on criteria.
13
13
This tool is super useful on both frontend and backend.
14
14
15
-
Example how to use with angular 2 in [plunker](http://plnkr.co/edit/Mja1ZYAjVySWASMHVB9R). Source code is [here](https://github.com/pleerock/class-transformer-demo).
15
+
Example how to use with angular 2 in [plunker](http://plnkr.co/edit/Mja1ZYAjVySWASMHVB9R).
16
+
Source code is [here](https://github.com/pleerock/class-transformer-demo).
16
17
17
18
## Installation
18
19
@@ -564,7 +565,7 @@ import {plainToClass} from "class-transformer";
564
565
this.http
565
566
.get("users.json")
566
567
.map(res=>res.json())
567
-
.map(res=>plainToClass(User, res))
568
+
.map(res=>plainToClass(User, resasObject[]))
568
569
.subscribe(users=> {
569
570
// now "users" is type of User[] and each user have getName() and isAdult() methods available
570
571
console.log(users);
@@ -573,6 +574,9 @@ this.http
573
574
574
575
You can also inject a class `ClassTransformer` as a service in `providers`, and use its methods.
575
576
577
+
Example how to use with angular 2 in [plunker](http://plnkr.co/edit/Mja1ZYAjVySWASMHVB9R).
578
+
Source code is [here](https://github.com/pleerock/class-transformer-demo).
579
+
576
580
## Samples
577
581
578
582
Take a look on samples in [./sample](https://github.com/pleerock/class-transformer/tree/master/sample) for more examples of
0 commit comments