+ All Categories
Home > Software > Intro to Knockout.JS for Salesforce1

Intro to Knockout.JS for Salesforce1

Date post: 01-Dec-2014
Category:
Upload: boris-bachovski
View: 172 times
Download: 3 times
Share this document with a friend
Description:
Intro to Knockout.JS for Salesforce1
6
Introduction to KnockoutJS 1
Transcript
Page 1: Intro to Knockout.JS for Salesforce1

1

Introduction to KnockoutJS

Page 2: Intro to Knockout.JS for Salesforce1

What We’re Going to Do

• Get our hands dirty with KnockoutJS• Some basic knowledge of Javascript, Apex and Visualforce

would be beneficial• We’re going to build a simple, fast, contact viewer

Page 3: Intro to Knockout.JS for Salesforce1

KnockoutJS?

• KnockoutJS is a Javascript framework for building quick, single-page applications

• Requires less boilerplate that a lot of frameworks, and is conceptually simpler than many

• Turns out it’s very easy to use with Javascript remoting!

Page 4: Intro to Knockout.JS for Salesforce1

KnockoutJS Architecture

• Knockout uses a Model – View – View Model (MVVM) pattern

• The Model is our Salesforce schema and data• The View displays data from, and triggers actions on the

view model• The View Model is pure code that interacts with the

model, and provides data and actions for the View

Page 5: Intro to Knockout.JS for Salesforce1

View Model and Bindings

• The View Model has properties called observables:self.name = ko.observable(‘Bob’);• The View can bind to these:<span data-bind=“text: name”/>• When the observable value changes, the view changes!

Page 6: Intro to Knockout.JS for Salesforce1

Learn More!

• You’re probably hooked by now, so check out these resources to learn more about KnockoutJS:–Interactive tutorials at http://learn.knockoutjs.com/–RTFM! It’s simply written, comprehensive, and logical

(something all to rare these days) http://knockoutjs.com/documentation/introduction.html


Recommended