Knockoutjs_Succinctly.pdf
(
1637 KB
)
Pobierz
1
By
Ryan Hodson
Foreword by Daniel Jebaraj
2
Copyright © 2012 by Syncfusion Inc.
2501 Aerial Center Parkway
Suite 200
Morrisville, NC 27560
USA
All rights reserved.
I
mportant licensing information. Please read.
This book is available for free download from
www.syncfusion.com
on completion
of a registration form.
If you obtained this book from any other source, please register and download a
free copy from
www.syncfusion.com.
This book is licensed for reading only if obtained from
www.syncfusion.com.
This book is licensed strictly for personal, educational use.
Redistribution in any form is prohibited.
The authors and copyright holders provide absolutely no warranty for any
information provided.
The authors and copyright holders shall not be liable for any claim, damages, or
any other liability arising from, out of, or in connection with the information in
this book.
Please do not use this book if the listed terms are unacceptable.
Use shall constitute acceptance of the terms listed.
E
dited by
This publication was edited by Daniel Jebaraj, vice president, Syncfusion, Inc.
3
Table of Contents
The Story behind the
Succinctly
Series of Books ...................................................... 8
About the Book ........................................................................................................... 10
Introduction ................................................................................................................. 11
Other Features ........................................................................................................... 12
Pure JavaScript ...................................................................................................... 12
Extensible ............................................................................................................... 12
Utility Functions ...................................................................................................... 13
What Knockout.js is
Not
............................................................................................. 13
Chapter 1 Conceptual Overview ................................................................................ 14
Observables ............................................................................................................... 14
Bindings ..................................................................................................................... 15
Summary ................................................................................................................... 15
Chapter 2 Hello, Knockout.js ..................................................................................... 16
Download Knockout.js................................................................................................ 16
The HTML .................................................................................................................. 16
Defining the ViewModel ............................................................................................. 17
Binding an HTML Element ......................................................................................... 18
Observable Properties ............................................................................................... 18
Accessing Observables .......................................................................................... 19
Using Custom Objects ............................................................................................... 19
Interactive Bindings .................................................................................................... 20
Summary ................................................................................................................... 21
Chapter 3 Observables .............................................................................................. 22
Computed Observables ............................................................................................. 23
4
Observable Arrays ..................................................................................................... 24
Adding Items ........................................................................................................... 25
Deleting Items ......................................................................................................... 26
Destroying Items ..................................................................................................... 27
Other Array Methods............................................................................................... 28
Summary ................................................................................................................... 29
Chapter 4 Control-Flow Bindings.............................................................................. 30
The foreach Binding ................................................................................................... 30
Working with Binding Contexts ................................................................................... 30
The $root Property .................................................................................................. 31
The $data Property ................................................................................................. 31
The $index Property ............................................................................................... 32
The $parent Property .............................................................................................. 32
Discounted Products .................................................................................................. 32
The if and ifnot Bindings ............................................................................................. 33
The with Binding ........................................................................................................ 34
Summary ................................................................................................................... 35
Chapter 5 Appearance Bindings ............................................................................... 36
The text Binding ......................................................................................................... 36
The html Binding ........................................................................................................ 37
The visible Binding ..................................................................................................... 38
The css Binding ......................................................................................................... 38
The style Binding ....................................................................................................... 39
The attr Binding.......................................................................................................... 40
Summary ................................................................................................................... 40
Chapter 6 Interactive Bindings .................................................................................. 41
5
Plik z chomika:
Razi
Inne pliki z tego folderu:
JAVASCRIPT_TESTING_BEGINNERS_GUIDE.pdf
(3802 KB)
beginning_jquery.pdf
(3418 KB)
OReilly.You.Feb.2015.ISBN.1491904194.pdf
(3700 KB)
pro_javascript_techniques.pdf
(3519 KB)
OReilly.This.Jul.2014.ISBN.1491904151.pdf
(3035 KB)
Inne foldery tego chomika:
Python
Wordpress themes
Zgłoś jeśli
naruszono regulamin