Getting Started with Knockout.js for .NET Developers
eBook - ePub

Getting Started with Knockout.js for .NET Developers

Andrey Akinshin

Compartir libro
  1. 188 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Getting Started with Knockout.js for .NET Developers

Andrey Akinshin

Detalles del libro
Vista previa del libro
Índice
Citas

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Getting Started with Knockout.js for .NET Developers un PDF/ePUB en línea?
Sí, puedes acceder a Getting Started with Knockout.js for .NET Developers de Andrey Akinshin en formato PDF o ePUB, así como a otros libros populares de Computer Science y Application Development. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2015
ISBN
9781783984008

Getting Started with Knockout.js for .NET Developers


Table of Contents

Getting Started with Knockout.js for .NET Developers
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction to Knockout.js
Knockout.js overview
What is Knockout.js?
The best features
MVVM design pattern
Installing Knockout.js
Method 1 – official site
Method 2 – NuGet
Method 3 – CDNs
Method 4 – GitHub
Knockout.js fundamentals
Creating a View
Adding a ViewModel
Adding a data binding
Adding an observable
Subscribing to observables
Updating View in a forced way
Delaying and suppressing change notifications
Adding dynamic behavior
A binding diversity
Single and multiple bindings
Value representation
White spaces
Skipping the value
Useful links
Summary
2. Creating a Simple Knockout.js Application
Creating the Model, View, and ViewModel
Text and appearance bindings
The text binding
The html binding
The css binding
The style binding
The attr binding
The visible binding
Form fields bindings
The value binding
The click binding
The submit binding
The event binding
The checked binding
The enable and disable binding
The options binding
The selectedOptions binding
Control flow bindings
The foreach binding
The if and ifnot bindings
The with binding
Computed observables
Using a computed observable
Computed observable features
Observable arrays
Using an observable array
Adding to an observable array
Removing from an observable array
Manipulating an observable array
Summary
3. Integrating Knockout.js in ASP.NET MVC Applications
Creating an application without Knockout.js
Creating a new project
Adding models
Adding views
Adding the Controller
Running the application
Creating an application with Knockout.js
Motivation
Creating a new project
Adding models
Adding views
Adding the controller
Running the application
Summary
4. Creating a Web Application with Knockout MVC
Getting started with Knockout MVC
Motivation
When you should use Knockout MVC
Installation
Useful links
Working with the Hello World example in Knockout MVC
Adding the model
Adding the controller
Adding the view
Running the application
Under the hood
Developing a Knockout MVC application
Adding the model
Adding the controller
Adding the view
Running the application
Under the hood
Summary
5. Advanced Features of Knockout.js
Loading and saving JSON data
Converting data to JSON
Converting JSON to data
Introducing Knockout mapping
A manual mapping example
An automatic mapping example
Mapping in Knockout MVC
Mapping unique values
Partial mapping – create
Partial mapping – update
Partial mapping – ignore
Multiple mappings
Advanced mapping
Binding context
Custom bindings
Registering a new binding
Binding callbacks' parameters
A custom binding example 1 – slideVisible
A custom binding example 2 – hasFocus
Extending observables
Creating an extender
An extending observables example 1 – numeric
An extending observables example 2 – required
Custom functions
An example with array filtering
Different templating approaches
A simple named template
Template in the foreach mode
The foreach template with alias
Choosing a template dynamically
Summary
6. Advanced Features of Knockout MVC
Regions
The foreach region
The with region
The if region
Complex bindings
Sending parameters to the server
Inner computed properties
Multiple view models
Lazy loading
Writing user scripts
Summary
A. A Brief on Knockout MVC References and Features
Working with KnockoutContext
Basic data binding
Form objects
Nested contexts
Sending requests to the server
Adding user-defined scripts
Forming a model and using computed properties
Special addressing forms
Summary
Index

Getting Started with Knockout.js for .NET Developers

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2015
Production reference: 1200515
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-400-8
www.packtpub.com

Credits

Author
Andrey Akinshin
Reviewers
Dmitry Pavlov
Tim Stuyckens
Commissioning Editor
Taron Pereira
Acquisition Editors
Owen Roberts
Greg Wild
Content Development Editors
Akshay Nair
Rohit Kumar Singh
Technical Editor
Taabish Khan
Copy Editor
Adithi Shetty
Project Coordinator
Mary Alex
Proofreaders
Safis Editing
Paul Hindle
Indexer
Priya Sane
Production Coordinator
Nitesh Thakur
Cover Work
Nitesh Thakur

About the Author

Andrey Akinshin has a PhD in computer science, and he received a Microsoft MVP award in 2015. He works as a lead .NET Developer at Perpetuum Software and as a postdoctoral research fellow at the Weizmann Institute of Science. He is also the author and main contributor of the Knockout MVC library and has a wealth of experience in Knockout.js. He has experience in various IT areas, ...

Índice