KnockoutJS Web Development
eBook - ePub

KnockoutJS Web Development

John Farrar

Share book
  1. 178 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

KnockoutJS Web Development

John Farrar

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is KnockoutJS Web Development an online PDF/ePUB?
Yes, you can access KnockoutJS Web Development by John Farrar in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Development. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781782161028

KnockoutJS Web Development


Table of Contents

KnockoutJS Web Development
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. Getting Started with KnockoutJS
Installing KnockoutJS
Looking at MVVM
Binding DOM elements using Knockout
Binding text
Binding HTML
Binding CSS
Binding numbers
Managing visibility
Multibound control
Power development using browser developer tools
The Knockout debugger
Shortcuts
The DOM inspection
The AJAX inspection
The resource inspection
The device emulation
Using internal functions with Knockout
Preventing hidden features
Automating calculations with Knockout
Subtotal calculation
Tax time
Final total
Working with non-Knockout functions
Summary
2. Using Arrays, Nesting, and Grids
Conditional binding
Introduction to arrays in Knockout
Working with array collections
Removing the last item
Sorting time
The simpleGrid plugin
Running the code
Final sort
Summary
3. Giving Forms the Knockout Touch
Event binding
The binding markup
The binding checkbox with visibility
Modifier keys
Default actions
Preventing bubbling
The textInput binding
Dynamic focus
Radio and checkbox binding
Enhanced event integration
Select binding
Selecting elements with the object collections
Listing the management Knockout style
The uniqueName binding
Grid forms
Summary
4. Coding – AJAX, Binding Properties, Mapping, and Utilities
JSON done Knockout style
Mapping – first look
Connecting with AJAX remotely
Unmapping your data
Merging mapped data
Mapping options
Utility functions
ko.utils.arrayFilter()
ko.utils.arrayFirst()
ko.utils.arrayMap()
ko.utils.arrayGetDistinctValues ()
ko.utils.arrayForEach()
ko.utils.compareArrays()
Purifying our computations
Coding documents for computed observables
Form 1
Form 2
Form 3
Form 4
Using a computed observable
Using the computed context
Summary
5. The Joy of Templates
Native templates
Enhanced collection handling
Render event handling
Third-party template options
Modified template handling with Underscore
Live updates and the subscribe method in Knockout
Awesome template options
Summary
6. Packaged Elegance
Introduction to components
Dynamic component selection
Bring Your Own Tags (BYOT)
Enhancing attribute handling
Building your own libraries
Bootstrap component example
Understanding the AMD approach
Component-based SPAs
Best development strategies
Getting real
Coding time
Adding navigation
Adding pages
Time for some custom style
Bonus item
Building cross-page interaction
What next?
Summary
Index

KnockoutJS Web Development

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: February 2015
Production reference: 1210215
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-102-8
www.packtpub.com

Credits

Author
John Farrar
Reviewers
Paul Manzotti
Julia Rechkunova
Tatsuro Shibamura
Cristian Trifan
Saul Wiggin
Commissioning Editor
Mary Nadar
Acquisition Editor
Nikhil Karkal
Content Development Editor
Manasi Pandire
Technical Editor
Prajakta Mhatre
Copy Editors
Puja Lalwani
Vikrant Phadke
Laxmi Subramanian
Project Coordinator
Leena Purkait
Proofreaders
Simran Bhogal
Maria Gould
Paul Hindle
Chris Smith
Indexer
Mariammal Chettiyar
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph

About the Author

John Farrar is a man who has a passion for pragmatic technology. He started working on computers in the late 70s and has watched the trends as closely as he watches the milestones. His work included programming on early computers, repairing military flight simulators in the navy, and working on web technology that helps people get business done. This work included building early commerce solutions for Apple, Brunswick Recreation, and Casio and working for a number of other companies along the letters of the alphabet. He is inspired and passionate about understanding the need before choosing the technology that answers the challenge.
Over the years, John has worked on a couple of books for ColdFusion, multiple open source projects from early Fusebox, community participation with jQuery, and some frameworks he created on his own. He has spoken at about a dozen conferences over the years and worked on supporting local and online users as time has permitted. He has provided technical training from online courses, in person class instructions, and a number of great intern programmers that let him share their entrance into the world of writing software.

About the Reviewers

Paul Manzotti created his first website in 1995, running the newly released CERN httpd on a spare Silicon Graphics machine in the lab he was working in.
A decade of designing websites progressing into mild programming using Microsoft's ASP technology ended with him going back to university to gain an MSc in computer programming.
Then he came out fully armed as a programmer and started using ASP.NET with a lot of heavy JavaScript work; that's what single-page applications (SPA) are all about. And hence, when single-page applications became a thing, he was more than happy to dive into it.
He is a senior developer at Purple Bricks (https://www.purplebricks.com/).
Julia Rechkunova is a software engineer who is inspired by web development and design. She has over 4 years of experience and focuses on the quality and usability of web applications. She enjoys working as a frontend developer as well as a backend developer. Modern web technologies and tools are the best instruments that help her bui...

Table of contents