SlideShare uma empresa Scribd logo
1 de 28
Using MVVM on
the web with Ignite
UI & Knockoutjs



                                        NISHANTH ANIL
                             TECHNICAL EVANGELIST
                      nanil@infragistics.com | nnish.com
                          facebook.com/InfragisticsIndia

                                                 @nishanil
Agenda
– Patterns
– What’s MVVM?
– What’s Knockoutjs?
  • Simple MVVM Demo
– What’s Ignite UI?
  • Building Enterprise Dashboard in HTML5/jQuery
    demo
– Comparing Javascript MV* frameworks


                                                @nishanil
Patterns – are guidelines not
              rules!
• UI patterns
  –   Model – View – Controller
  –   Model – View – Presenter
  –   Presentation Model
  –   Model – View – ViewModel


• Why do they exist?
  – Separation of concerns
  – Testability
  – Maintainability


                                  @nishanil
MVVM?

 View    ViewModel      Model
(HTML)               (jsonxml)




                                  @nishanil
MVVM recap – WPF
   –   INotifyPropertyChanged/INotifyCollectionChanged
   –   DataContext
   –   DataBinding
   –   Commanding

Read more:
http://nnish.in/myIGblog




                                                         @nishanil
MVVM on the web?




                   @nishanil
@nishanil
What’s knockoutjs?
– a compact javascript library
– implements the MVVM pattern for Javascript
– rich client-side interactivity
– supports all major browsers



     6+           2+

     http://knockoutjs.com/documentation/browser-support.html



                                                                @nishanil
Key Concepts




               @nishanil
Knockout in 3 steps
– Declarative Binding


– Dependency Tracking using Observable



– Activating knockout




                                         @nishanil
Observables
– Updates UI automatically when the
  ViewModel changes (UI notification)
– Very famous 2 way binding!
– Declare your properties as ko.observable()
– ko.observable() objects are functions, not a
  property!




                                                 @nishanil
Computed Observables
– Computes value based on one more
  dependent observable (for e.g, compute full
  name based on first name & last name)




                                            @nishanil
Declarative Binding
 – It’s all about data-bind attribute in HTML
 – Not native to HTML, but perfectly OK!
 – The binding value can be a single value, variable, or
   literal or almost any valid JavaScript expression.




         Built-in Bindings                     valueUpdate options
value, visible, text,                    change, keyup, keypre
uniqueName, click                        ss, afterkeydown
etc…
Not happy with built-in bindings? – roll your own! (custom bindings)
                                                                       @nishanil
Observable Array
– Tracks which objects are in the array, not the
  state of those objects
– Notifies changes for add & remove
– No notification for item changes! (use
 ko.observable())
Pre-populating ObservableArray




          Binding it



                                              @nishanil
Built-in Bindings
                        Text & Appearance

 visible      text        attr       style         css        html




                      Working with Form Fields


click       disable    submit       value        hasfocu     enable
                                                    s

event      checked      options    selectedOptions         uniqueName



            Or roll your own! Support s custom binding


                                                                      @nishanil
Binding – Control Flow
foreach
                     Foreach example
  if

 ifnot

 with




                                @nishanil
Knockout & jQuery
• Not a jQuery competitor, Knockout solves
  a different problem!
• Will work together!




                                         @nishanil
Knockoutjs Demo




                  @nishanil
Enterprise dashboards using
      HTML5/jQuery?



                         @nishanil
@nishanil
The World’s Most Advanced
  JavaScript & HTML5 UI
       Framework


                        @nishanil
@nishanil
and a lot more… www.igniteui.com
                                   @nishanil
Ignite UI Demo




                 @nishanil
Javascript MV* F/W           Web
                                       Composed                  Plays Nicely
        Framework        UI Bindings              Presentation
                                       Views                     With Others
                                                  Layer
        Backbone.js      ✗             ✗          ✓              ✓
        SproutCore 1.x   ✓             ✓          ✗              ✗
        Sammy.js         ✗             ✗          ✓              ✓
        Spine.js         ✗             ✗          ✓              ✓
        Cappuccino       ✓             ✓          ✗              ✗
        Knockout.js      ✓             ✗          ✓              ✓
        Javascript
                         ✗             ✓          ✓              ✓
        MVC
        Google Web
                         ✗             ✓          ✗              ✗
        Toolkit
        Google
                         ✗             ✓          ✓              ✗
        Closure
        Ember.js         ✓             ✓          ✓              ✓
        Angular.js       ✓             ✗          ✓              ✓
        Batman.js        ✓             ✗          ✓              ✓
Source: http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/
                                                                                @nishanil
Resources
– Ignite UI
   • www.igniteui.com
– Infragistics Community
   • http://www.infragistics.com/community/
– KnockoutJS –
   • learn.knockoutjs.com
   • http://www.knockmeout.net/
– If you are new to Javascript
   •   https://developer.mozilla.org/en-US/docs/JavaScript/Guide
– Javascript MVC Frameworks reviewed
   • http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-
     reviewed/


                                                                   @nishanil
Slides & Samples
• You can download these slides from
  – http://www.slideshare.net/nishanthanil/
• Samples
  – Knockout
    • https://github.com/nishanil/koSamples
  – Ignite UI Grid & Knockoutjs
    • http://www.infragistics.com/products/jquery/sample
      /grid/grid-knockoutjs-integration



                                                     @nishanil
Q&A

@nishanil on twitter
facebook.com/InfragisticsIndia



                                                   NISHANTH ANIL
                                        TECHNICAL EVANGELIST
                                 nanil@infragistics.com | nnish.com

                                                            @nishanil

Mais conteúdo relacionado

Semelhante a Using mvvm on the web using knockoutjs & ignite ui

Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsNish Anil
 
Infragistics: Getting Started with MVVM in WPF & Silverlight
Infragistics: Getting Started with MVVM in WPF & SilverlightInfragistics: Getting Started with MVVM in WPF & Silverlight
Infragistics: Getting Started with MVVM in WPF & SilverlightNish Anil
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayWesley Hales
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5Chris Bannon
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Gill Cleeren
 
Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts weili_at_slideshare
 
Flu3nt highlights
Flu3nt highlightsFlu3nt highlights
Flu3nt highlightsdswork
 
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjsCodemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjsFabio Franzini
 
JS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSJS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSYuriy Silvestrov
 
Active Web Development
Active Web DevelopmentActive Web Development
Active Web DevelopmentDivya Manian
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Peter Lubbers
 
Building assets on the fly with Node.js
Building assets on the fly with Node.jsBuilding assets on the fly with Node.js
Building assets on the fly with Node.jsAcquisio
 
Structure mapping your way to better software
Structure mapping your way to better softwareStructure mapping your way to better software
Structure mapping your way to better softwarematthoneycutt
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
A Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVMA Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVMChris Bannon
 
Seattle bestpractices2010
Seattle bestpractices2010Seattle bestpractices2010
Seattle bestpractices2010Olaseni Odebiyi
 
Evaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesEvaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesMario Gonzalez
 
Kicking Up the Dust with Node JS
Kicking Up the Dust with Node JSKicking Up the Dust with Node JS
Kicking Up the Dust with Node JSBill Scott
 

Semelhante a Using mvvm on the web using knockoutjs & ignite ui (20)

Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with Knockoutjs
 
Infragistics: Getting Started with MVVM in WPF & Silverlight
Infragistics: Getting Started with MVVM in WPF & SilverlightInfragistics: Getting Started with MVVM in WPF & Silverlight
Infragistics: Getting Started with MVVM in WPF & Silverlight
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies Today
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8
 
Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts
 
Flu3nt highlights
Flu3nt highlightsFlu3nt highlights
Flu3nt highlights
 
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjsCodemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
 
JS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSJS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJS
 
Active Web Development
Active Web DevelopmentActive Web Development
Active Web Development
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)
 
Building assets on the fly with Node.js
Building assets on the fly with Node.jsBuilding assets on the fly with Node.js
Building assets on the fly with Node.js
 
Structure mapping your way to better software
Structure mapping your way to better softwareStructure mapping your way to better software
Structure mapping your way to better software
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
Angular js gtg-27feb2013
Angular js gtg-27feb2013Angular js gtg-27feb2013
Angular js gtg-27feb2013
 
A Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVMA Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVM
 
Seattle bestpractices2010
Seattle bestpractices2010Seattle bestpractices2010
Seattle bestpractices2010
 
Evaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesEvaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devices
 
Kicking Up the Dust with Node JS
Kicking Up the Dust with Node JSKicking Up the Dust with Node JS
Kicking Up the Dust with Node JS
 

Mais de Nish Anil

[MobConf] Go mobile with C#, Visual Studio & Xamarin
[MobConf] Go mobile with C#, Visual Studio & Xamarin[MobConf] Go mobile with C#, Visual Studio & Xamarin
[MobConf] Go mobile with C#, Visual Studio & XamarinNish Anil
 
[MobConf] Programming wearables in c#
[MobConf] Programming wearables in c#[MobConf] Programming wearables in c#
[MobConf] Programming wearables in c#Nish Anil
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsNish Anil
 
[Bdotnet] Cloud connected mobile apps
[Bdotnet] Cloud connected mobile apps[Bdotnet] Cloud connected mobile apps
[Bdotnet] Cloud connected mobile appsNish Anil
 
Evolve recap XHackers, Bangalore
Evolve recap XHackers, BangaloreEvolve recap XHackers, Bangalore
Evolve recap XHackers, BangaloreNish Anil
 
iOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamariniOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamarinNish Anil
 
Building mvvm & single pageapps in js
Building mvvm & single pageapps in jsBuilding mvvm & single pageapps in js
Building mvvm & single pageapps in jsNish Anil
 

Mais de Nish Anil (7)

[MobConf] Go mobile with C#, Visual Studio & Xamarin
[MobConf] Go mobile with C#, Visual Studio & Xamarin[MobConf] Go mobile with C#, Visual Studio & Xamarin
[MobConf] Go mobile with C#, Visual Studio & Xamarin
 
[MobConf] Programming wearables in c#
[MobConf] Programming wearables in c#[MobConf] Programming wearables in c#
[MobConf] Programming wearables in c#
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.Forms
 
[Bdotnet] Cloud connected mobile apps
[Bdotnet] Cloud connected mobile apps[Bdotnet] Cloud connected mobile apps
[Bdotnet] Cloud connected mobile apps
 
Evolve recap XHackers, Bangalore
Evolve recap XHackers, BangaloreEvolve recap XHackers, Bangalore
Evolve recap XHackers, Bangalore
 
iOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamariniOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using Xamarin
 
Building mvvm & single pageapps in js
Building mvvm & single pageapps in jsBuilding mvvm & single pageapps in js
Building mvvm & single pageapps in js
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

Using mvvm on the web using knockoutjs & ignite ui

  • 1. Using MVVM on the web with Ignite UI & Knockoutjs NISHANTH ANIL TECHNICAL EVANGELIST nanil@infragistics.com | nnish.com facebook.com/InfragisticsIndia @nishanil
  • 2. Agenda – Patterns – What’s MVVM? – What’s Knockoutjs? • Simple MVVM Demo – What’s Ignite UI? • Building Enterprise Dashboard in HTML5/jQuery demo – Comparing Javascript MV* frameworks @nishanil
  • 3. Patterns – are guidelines not rules! • UI patterns – Model – View – Controller – Model – View – Presenter – Presentation Model – Model – View – ViewModel • Why do they exist? – Separation of concerns – Testability – Maintainability @nishanil
  • 4. MVVM? View ViewModel Model (HTML) (jsonxml) @nishanil
  • 5. MVVM recap – WPF – INotifyPropertyChanged/INotifyCollectionChanged – DataContext – DataBinding – Commanding Read more: http://nnish.in/myIGblog @nishanil
  • 6. MVVM on the web? @nishanil
  • 8. What’s knockoutjs? – a compact javascript library – implements the MVVM pattern for Javascript – rich client-side interactivity – supports all major browsers 6+ 2+ http://knockoutjs.com/documentation/browser-support.html @nishanil
  • 9. Key Concepts @nishanil
  • 10. Knockout in 3 steps – Declarative Binding – Dependency Tracking using Observable – Activating knockout @nishanil
  • 11. Observables – Updates UI automatically when the ViewModel changes (UI notification) – Very famous 2 way binding! – Declare your properties as ko.observable() – ko.observable() objects are functions, not a property! @nishanil
  • 12. Computed Observables – Computes value based on one more dependent observable (for e.g, compute full name based on first name & last name) @nishanil
  • 13. Declarative Binding – It’s all about data-bind attribute in HTML – Not native to HTML, but perfectly OK! – The binding value can be a single value, variable, or literal or almost any valid JavaScript expression. Built-in Bindings valueUpdate options value, visible, text, change, keyup, keypre uniqueName, click ss, afterkeydown etc… Not happy with built-in bindings? – roll your own! (custom bindings) @nishanil
  • 14. Observable Array – Tracks which objects are in the array, not the state of those objects – Notifies changes for add & remove – No notification for item changes! (use ko.observable()) Pre-populating ObservableArray Binding it @nishanil
  • 15. Built-in Bindings Text & Appearance visible text attr style css html Working with Form Fields click disable submit value hasfocu enable s event checked options selectedOptions uniqueName Or roll your own! Support s custom binding @nishanil
  • 16. Binding – Control Flow foreach Foreach example if ifnot with @nishanil
  • 17. Knockout & jQuery • Not a jQuery competitor, Knockout solves a different problem! • Will work together! @nishanil
  • 18. Knockoutjs Demo @nishanil
  • 19. Enterprise dashboards using HTML5/jQuery? @nishanil
  • 21. The World’s Most Advanced JavaScript & HTML5 UI Framework @nishanil
  • 23. and a lot more… www.igniteui.com @nishanil
  • 24. Ignite UI Demo @nishanil
  • 25. Javascript MV* F/W Web Composed Plays Nicely Framework UI Bindings Presentation Views With Others Layer Backbone.js ✗ ✗ ✓ ✓ SproutCore 1.x ✓ ✓ ✗ ✗ Sammy.js ✗ ✗ ✓ ✓ Spine.js ✗ ✗ ✓ ✓ Cappuccino ✓ ✓ ✗ ✗ Knockout.js ✓ ✗ ✓ ✓ Javascript ✗ ✓ ✓ ✓ MVC Google Web ✗ ✓ ✗ ✗ Toolkit Google ✗ ✓ ✓ ✗ Closure Ember.js ✓ ✓ ✓ ✓ Angular.js ✓ ✗ ✓ ✓ Batman.js ✓ ✗ ✓ ✓ Source: http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/ @nishanil
  • 26. Resources – Ignite UI • www.igniteui.com – Infragistics Community • http://www.infragistics.com/community/ – KnockoutJS – • learn.knockoutjs.com • http://www.knockmeout.net/ – If you are new to Javascript • https://developer.mozilla.org/en-US/docs/JavaScript/Guide – Javascript MVC Frameworks reviewed • http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks- reviewed/ @nishanil
  • 27. Slides & Samples • You can download these slides from – http://www.slideshare.net/nishanthanil/ • Samples – Knockout • https://github.com/nishanil/koSamples – Ignite UI Grid & Knockoutjs • http://www.infragistics.com/products/jquery/sample /grid/grid-knockoutjs-integration @nishanil
  • 28. Q&A @nishanil on twitter facebook.com/InfragisticsIndia NISHANTH ANIL TECHNICAL EVANGELIST nanil@infragistics.com | nnish.com @nishanil