
KnockoutJS Essentials
Beschreibung
If you are a JavaScript developer who has been using DOM manipulation libraries such as Mootools or Scriptaculous, and you want go further in modern JavaScript development with a simple and well-documented library, then this book is for you. Learning how to use Knockout will be perfect as your next step towards building JavaScript applications that respond to user interaction.
Alle Preise
Weitere Details
Weitere Ausgaben
Inhalt
- Intro
- KnockoutJS Essentials
- Table of Contents
- KnockoutJS Essentials
- Credits
- About the Author
- Acknowledgments
- 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. Refreshing the UI Automatically with KnockoutJS
- KnockoutJS and the MVVM pattern
- A real-world application - koCart
- Installing components
- The view-model
- The view
- The model
- Observables to refresh the UI automatically
- Managing collections with observables
- Inserting elements in collections
- Computed observables
- Summary
- 2. KnockoutJS Templates
- Preparing the project
- Creating templates
- The header template
- The catalog template
- The add-to-cart-modal template
- The cart-widget template
- The cart-item template
- The cart template
- The order template
- The finish-order-modal template
- Handling templates with if and ifnot bindings
- Managing templates with jQuery
- Managing templates with koExternalTemplateEngine
- Summary
- 3. Custom Bindings and Components
- Custom bindings
- The toggle binding
- The currency binding
- Create a binding to debug - the toJSON binding
- Being semantic with our bindings
- Wrapping a jQuery plugin into a custom binding
- Components - isolated view-models
- Advanced techniques
- Controlling descendant bindings
- Using virtual elements
- Preprocessing data before binding
- Summary
- 4. Managing KnockoutJS Events
- Event-driven programming
- The click event
- Passing more parameters
- Allowing the default click action
- Event bubbling
- Event types
- Event binding
- Unobtrusive events with jQuery
- Delegation pattern
- Building custom events
- Events and bindings
- Summary
- 5. Getting Data from the Server
- REST services
- Defining CRUD
- Singleton resources
- Setting CRUD operations in the resource
- Using resources in the view-model
- Using Mockjax to mock HTTP requests
- Generating mock data with MockJSON
- Retrieving a product by ID
- Creating a new product
- Separation of concerns - behavior and data
- Creating the product service
- Creating the CartProduct service
- Updating a product
- Deleting a product
- Sending the order to the server
- Handling AJAX errors
- Validating data
- Extending the product model
- Extending the customer model
- Summary
- 6. The Module Pattern - RequireJS
- Installing the Knockout context debugger extension
- The console
- The module pattern
- Creating the Shop module
- The ViewModel module
- The Models module
- The Resources module
- The Services module
- Events, bindings, and Knockout components
- Updating the add-to-cart-button component
- Updating events
- Using RequireJS to manage dependencies
- Updating the template engine
- Configuring RequireJS
- Using RequireJS in our project
- Defining the app.js file
- Converting a normal module into an AMD module
- Applying RequireJS to components
- Applying RequireJS to mocks
- Applying RequireJS to bindings
- Applying RequireJS to events
- The limits of the application
- Summary
- 7. Durandal - The KnockoutJS Framework
- Installing Durandal
- Durandal patterns
- The index.html file
- The main.js file
- The shell view-model
- The shell view
- Durandal life cycle
- The activation life cycle
- The promise pattern
- Compositions
- Object composition
- Visual composition
- Router
- Route parameters
- Triggering navigation
- Child routers
- Events
- Widgets
- Setting up widgets
- Writing the widget view
- Writing the widget view-model
- Registering the widget
- Building a page with Durandal
- Summary
- 8. Developing Web Applications with Durandal - The Cart Project
- Introduction
- Setting up the project
- Routing the project - the shell view-model
- The navigation and shell templates
- The catalog module
- The catalog view
- The catalog view-model
- The cart service
- The log service
- Adding products to the catalog
- The add product view
- The edit view
- The add product view-model
- Making mocks real
- The edit view-model
- The cart module
- The cart view
- The cart view-model
- The order module
- The order view
- The order view-model
- Grouping code by feature - managing big projects
- Summary
- Index
Systemvoraussetzungen
Dateiformat: ePUB
Kopierschutz: Adobe-DRM (Digital Rights Management)
Systemvoraussetzungen:
- Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).
- Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions oder die App PocketBook (siehe E-Book Hilfe).
- E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)
Das Dateiformat ePUB ist sehr gut für Romane und Sachbücher geeignet – also für „fließenden” Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an.
Mit Adobe-DRM wird hier ein „harter” Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.
Bitte beachten Sie: Wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!
Weitere Informationen finden Sie in unserer E-Book Hilfe.
Dateiformat: PDF
Kopierschutz: Adobe-DRM (Digital Rights Management)
Systemvoraussetzungen:
- Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).
- Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions oder die App PocketBook (siehe E-Book Hilfe).
- E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)
Das Dateiformat PDF zeigt auf jeder Hardware eine Buchseite stets identisch an. Daher ist eine PDF auch für ein komplexes Layout geeignet, wie es bei Lehr- und Fachbüchern verwendet wird (Bilder, Tabellen, Spalten, Fußnoten). Bei kleinen Displays von E-Readern oder Smartphones sind PDF leider eher nervig, weil zu viel Scrollen notwendig ist.
Mit Adobe-DRM wird hier ein „harter” Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.
Bitte beachten Sie: Wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!
Weitere Informationen finden Sie in unserer E-Book Hilfe.