These code samples will be the most up to date samples for The NativeScript Book.
Most code examples will be are also provided with links to run and test on the NativeScript Playground
- button example: https://play.nativescript.org/?template=play-js&id=SoNAA2&v=5
- button example css: https://play.nativescript.org/?template=play-js&id=RMu0YK&v=1
- button example: https://play.nativescript.org/?template=play-js&id=DMgM12&v=3
- button example platform specific: https://play.nativescript.org/?template=play-js&id=8Rvb5i&v=3
- button example platform specific 2: https://play.nativescript.org/?template=play-js&id=3YXgih&v=2
- orientation: https://play.nativescript.org/?template=play-js&id=GpMfbe&v=2
- myapp: https://play.nativescript.org/?template=play-js&id=kZRkPj&v=2
- 4.1: https://play.nativescript.org/?template=play-js&id=JSPR2b&v=6
- 4.2: https://play.nativescript.org/?template=play-js&id=JSPR2b&v=9
- 4.3: https://play.nativescript.org/?template=play-js&id=JSPR2b&v=10
- 4.4: N/A
- 4.5: https://play.nativescript.org/?template=play-js&id=JSPR2b&v=16
- 4.6: https://play.nativescript.org/?template=play-js&id=JSPR2b&v=18
- 4.7: https://play.nativescript.org/?template=play-js&id=JSPR2b&v=42
- 4.8: https://play.nativescript.org/?template=play-js&id=JSPR2b&v=43
- 5.1: https://play.nativescript.org/?template=play-js&id=3OmKi1&v=3
- 5.2: https://play.nativescript.org/?template=play-js&id=3OmKi1&v=3 (same as 5.1)
- 5.3: https://play.nativescript.org/?template=play-js&id=89ootX&v=3
- 5.4: https://play.nativescript.org/?template=play-js&id=89ootX&v=12
- 5.5: https://play.nativescript.org/?template=play-js&id=89ootX&v=13
- 5.6: https://play.nativescript.org/?template=play-js&id=89ootX&v=14
- 5.7: https://play.nativescript.org/?template=play-js&id=89ootX&v=15
- 5.8: https://play.nativescript.org/?template=play-js&id=89ootX&v=16
- 5.9: https://play.nativescript.org/?template=play-js&id=89ootX&v=17
- 5.10: https://play.nativescript.org/?template=play-js&id=89ootX&v=18
- 5.11: https://play.nativescript.org/?template=play-js&id=89ootX&v=19
- 5.12: N/A
- 5.13: N/A
- 6.1: https://play.nativescript.org/?template=play-js&id=jJSQqX&v=2
- 6.2: https://play.nativescript.org/?template=play-js&id=2xxKKW&v=4
- 6.3: https://play.nativescript.org/?template=play-js&id=2xxKKW&v=5
- 6.4: https://play.nativescript.org/?template=play-js&id=2xxKKW&v=7
- 6.5: N/A
- 6.6: https://play.nativescript.org/?template=play-js&id=2xxKKW&v=8
- 7.1: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=3
- 7.2: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=5
- 7.3: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=6
- 7.4: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=7
- 7.5: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=8
- 7.6: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=9
- 7.7: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=10
- 7.8: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=12
- 7.9 & 7.10 & 7.11: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=15
- 7.12: https://play.nativescript.org/?template=play-js&id=0Xg8d6&v=2
- 7.13: N/A
- 7.14: N/A
- 7.15: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=16
- highlight image: https://play.nativescript.org/?template=play-js&id=8j4jSU&v=17
- 8.1: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=3
- 8.2: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=4
- 8.3: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=5
- 8.4 & 8.5: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=7
- 8.6, 8.7, & 8.8: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=9
- 8.9 & 8.10: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=10
- 8.11 & 8.12: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=16
- 8.13: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=17
- 8.14: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=20
- 8.15 & 8.16: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=21
- 8.17 (observable array example): https://play.nativescript.org/?template=play-js&id=9gsDfR&v=3
- 8.18 & 8.19: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=22
- 8.20: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=23
- 8.21 & 8.22: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=24
- 8.23: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=25
- 8.24: https://play.nativescript.org/?template=play-js&id=ihli0Y&v=26
- 9.1: https://play.nativescript.org/?template=play-js&id=iH0zRF&v=2
- 9.2: https://play.nativescript.org/?template=play-js&id=r547M9&v=3
- 9.3: https://play.nativescript.org/?template=play-js&id=r547M9&v=4
- 9.4: https://play.nativescript.org/?template=play-js&id=r547M9&v=5
- 9.5: N/A
- 9.6: https://play.nativescript.org/?template=play-js&id=r547M9&v=6
- 9.7 & 9.8: https://play.nativescript.org/?template=play-js&id=r547M9&v=10
- 9.9: https://play.nativescript.org/?template=play-js&id=r547M9&v=11
- 9.10: https://play.nativescript.org/?template=play-js&id=r547M9&v=12
- 9.11: https://play.nativescript.org/?template=play-js&id=r547M9&v=13
- 9.12: https://play.nativescript.org/?template=play-js&id=r547M9&v=14
- 9.13: https://play.nativescript.org/?template=play-js&id=r547M9&v=15
- 9.14 & 9.15: https://play.nativescript.org/?template=play-js&id=r547M9&v=16
- 9.16: https://play.nativescript.org/?template=play-js&id=r547M9&v=20
- 9.17: https://play.nativescript.org/?template=play-js&id=r547M9&v=21
- 10.1 & 10.2:https://play.nativescript.org/?template=play-js&id=L3oOX0&v=8
- 10.3: https://play.nativescript.org/?template=play-js&id=L3oOX0&v=9
- 10.4 & 10.5: N/A
- 10.6: https://play.nativescript.org/?template=play-js&id=L3oOX0&v=10
- 10.6 (circle images): https://play.nativescript.org/?template=play-js&id=L3oOX0&v=11
- 10.7: N/A
- 10.8: https://play.nativescript.org/?template=play-js&id=L3oOX0&v=12
- 10.9: https://play.nativescript.org/?template=play-js&id=L3oOX0&v=13
- 10.10 & 10.11: https://play.nativescript.org/?template=play-js&id=L3oOX0&v=14
- 11.1: https://play.nativescript.org/?template=play-js&id=557Zvo&v=3
- 11.2: https://play.nativescript.org/?template=play-js&id=557Zvo&v=4
- 11.3: https://play.nativescript.org/?template=play-js&id=557Zvo&v=5
- 11.4: https://play.nativescript.org/?template=play-js&id=557Zvo&v=6
- 11.5: https://play.nativescript.org/?template=play-js&id=557Zvo&v=7
- 11.6: https://play.nativescript.org/?template=play-js&id=557Zvo&v=8
- 11.7 - 11.10: https://play.nativescript.org/?template=play-js&id=557Zvo&v=9
- 11.10 + Homework (Gender Modal): https://play.nativescript.org/?template=play-js&id=557Zvo&v=27
- 11.11: https://play.nativescript.org/?template=play-js&id=557Zvo&v=28
- 11.12: https://play.nativescript.org/?template=play-js&id=557Zvo&v=29
- 11.13: https://play.nativescript.org/?template=play-js&id=557Zvo&v=30
- 11.14: https://play.nativescript.org/?template=play-js&id=557Zvo&v=31
- 11.15: N/A
- 11.16: https://play.nativescript.org/?template=play-js&id=557Zvo&v=34
- 11.17 - 11.21: https://play.nativescript.org/?template=play-js&id=557Zvo&v=35
- 11.22: https://play.nativescript.org/?template=play-js&id=557Zvo&v=36
- 11.23: N/A
- 11.24 & 11.25: https://play.nativescript.org/?template=play-js&id=557Zvo&v=37
- 11.26 - 11.28: https://play.nativescript.org/?template=play-js&id=557Zvo&v=38
- 11.29: https://play.nativescript.org/?template=play-js&id=557Zvo&v=39
- 11.30: https://play.nativescript.org/?template=play-js&id=557Zvo&v=40
- 11.31: https://play.nativescript.org/?template=play-js&id=557Zvo&v=41
- Beginning: https://play.nativescript.org/?template=play-ng&id=GfqjRH
- 16.1: https://play.nativescript.org/?template=play-ng&id=GfqjRH
- 16.2: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=4
- 16.3 - 16.9: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=6
- 16.10 - 16.14: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=26
- 16.15 - 16.19: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=29
- Beginning: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=29
- 17.1 - 17.2: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=30
- 17.3: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=36
- 17.4: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=37
- 17.5: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=38
- 17.6: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=39
- 17.7: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=43
- 17.8 - 17.11: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=49
- 17.12 - 17.13: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=50
- 17.14: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=52
- 17.15 - 17.16: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=53
- Two-way binding before 17.17: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=54
- Angular data formatting before 17.17: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=55
- 17.17 - 17.18: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=56
- 17.19: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=57
- 17.20: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=58
- 17.21 - 17.22: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=64
- 17.23: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=65
- 17.24: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=66
- 17.25: https://play.nativescript.org/?template=play-ng&id=GfqjRH&v=67