SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Parth Pandya
parth@varahitechnologies.com
 Application contained in only page and all
other resource are dynamically loaded in
single page container
 Some of benefits of it is
◦ You can easily make them compatible with different
devices (Such as mobile and web browsers)
◦ Being single page application it has reach user
experience and less round tripping to server
 Set of library as part of the visual studio
template that can be used to SPA
 It contains
◦ Durandal(For navigation)
◦ Knockout(For binding)
◦ Breeze(For client side data access)
◦ Toastr (For messages)
◦ Twitter bootstrap(For mobile compatibility and CSS
styling)
 Download WebTools 2012.2 update
http://weblogs.asp.net/scottgu/archive/2013/0
2/18/announcing-release-of-asp-net-and-web-
tools-2012-2-update.aspx or Install nuget
package for HotTowel
 Follow jonh papa’s blog at
http://www.johnpapa.net/hottowel/ or go
through
http://pluralsight.com/training/courses/TableOf
Contents?courseName=single-page-apps-
jumpstart and download complete plurasight
code from
https://github.com/johnpapa/PluralsightSpaJum
pStartFinal
•In HotTowel one can see App folder which
contains overall structure of the application and the
way it is going to behave
• Durandal folder contains navigation logic for
viewmodel , view and provide proper mapping
between different folder part of the project
• Shell.js contains navigation details and project
startup events. We can use activate or boot events
in order to register startup parameters for the in
our SPA or add new pages navigation inside boot
function.
• Services folder contains various services that we
are planning to use throughout our application
such as logger.js is already there for showing
toaster message. Similarly, we can create services
that will talk to our controller for retrieving data
•Viewmodels foder will contain JavaScript files
where will put logic to bind ui and call services to
save data
•Views folder will contain html files where we will
be putting UI markups
 Add new link in navigation (shell.js)
router.mapNav('employee');
 Add employee.js and employee.html
viewmodels and view respectively
 Modify content on employee.html and run
the application in order to see that the
content are reflected properly
 Create a model named Employee with Id and
Name property
 Run Enalbe-Migration command (Enable-
Migrations -ContextTypeName
HotTowelExample1.Models.EmployeeDBConte
xt)
 Execute add-migration Initial for creating
scripts for database tables
 Seed data in Configuration class
 Run update-database to populate data with
dummy records
 Create a Controller in Controller folder and
inherit it from ApiController and provide
[BreezeController] attribute for class
 Implement readonly property for
ContextAccess and Metadata() method for
consuming it with Breeze
 Implement GetEmployees method to return all
employees from BreezeController which will
be consumed by our client side application
 In App/Services crate model.js and
datacontext.js files
 In datacontex.js implement a function to
retreive data
 Take object of breeze.EntityQuery for
querying breeze controller and configure
manager by calling registerEntityTypeCtor on
each entity to be used in javascript
 This part is written in model.js file
 Create function getEmpoyees to retreive and
set observable collecton to be used by UI
 In ViewModel(employee.js) create file to
return observable to be used in view. Include
observable as part of return vm as to be
consumable with view
 Observable array will be passed to data
context for loading data and will be set with
employeeObservable(data.results)
 Use knockout binding to on UI
 Tip:() use to evaluate knockout properties
 Example for the slide can be found at
http://dms.varahitest.in/Example/HotTowelE
xample1.zip

Weitere ähnliche Inhalte

Was ist angesagt?

Building Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppBuilding Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppMuhammad Samu
 
Page life cycle
Page life cyclePage life cycle
Page life cycleanil4691
 
Ise312 Ec Presentation Jquery
Ise312 Ec Presentation JqueryIse312 Ec Presentation Jquery
Ise312 Ec Presentation Jqueryduygut
 
Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And WalkthroughsBryan Tuttle
 
Developing eXtensions for HUE
Developing eXtensions for HUEDeveloping eXtensions for HUE
Developing eXtensions for HUEMaksym Doroshenko
 
jQuery programming with visual web part
jQuery programming with visual web partjQuery programming with visual web part
jQuery programming with visual web partSenthamil Selvan
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS FrameworkRaveendra R
 
Converting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudConverting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudRoger Brinkley
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage ReportsPaul Graham
 
Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?InnovationM
 

Was ist angesagt? (13)

title
titletitle
title
 
reactJS
reactJSreactJS
reactJS
 
Building Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppBuilding Offline Ready and Installable Web App
Building Offline Ready and Installable Web App
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
 
Ise312 Ec Presentation Jquery
Ise312 Ec Presentation JqueryIse312 Ec Presentation Jquery
Ise312 Ec Presentation Jquery
 
Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And Walkthroughs
 
Developing eXtensions for HUE
Developing eXtensions for HUEDeveloping eXtensions for HUE
Developing eXtensions for HUE
 
jQuery programming with visual web part
jQuery programming with visual web partjQuery programming with visual web part
jQuery programming with visual web part
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS Framework
 
Converting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudConverting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile Cloud
 
Web component
Web componentWeb component
Web component
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage Reports
 
Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?
 

Andere mochten auch

Presentación de Adrima
Presentación de AdrimaPresentación de Adrima
Presentación de Adrimatolano
 
Materi sistem pernafasan manusia
Materi sistem pernafasan manusiaMateri sistem pernafasan manusia
Materi sistem pernafasan manusiaSharah Sharah
 
Powering front end apps with NServiceBus
Powering front end apps with NServiceBusPowering front end apps with NServiceBus
Powering front end apps with NServiceBusBritt King
 
Testamentode Cristo
Testamentode CristoTestamentode Cristo
Testamentode Cristoguest12766c
 
Florencia Nieves
Florencia NievesFlorencia Nieves
Florencia Nievesguest12766c
 
App modernization and evented architectures with Node.js
App modernization and evented architectures with Node.jsApp modernization and evented architectures with Node.js
App modernization and evented architectures with Node.jsScott Persinger
 
Making workflow implementation easy with CQRS
Making workflow implementation easy with CQRSMaking workflow implementation easy with CQRS
Making workflow implementation easy with CQRSParticular Software
 
ReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page ApplicationsReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page ApplicationsRick Beerendonk
 
“творчий педагог – творчі діти”
“творчий  педагог – творчі діти”“творчий  педагог – творчі діти”
“творчий педагог – творчі діти”jekah
 
Dium Corp A08cas
Dium Corp A08casDium Corp A08cas
Dium Corp A08casguest12766c
 
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015E-commerce Solutions
 
Hiroshima And Nagasaki
Hiroshima And NagasakiHiroshima And Nagasaki
Hiroshima And Nagasakiguest12766c
 

Andere mochten auch (19)

Presentación de Adrima
Presentación de AdrimaPresentación de Adrima
Presentación de Adrima
 
Materi sistem pernafasan manusia
Materi sistem pernafasan manusiaMateri sistem pernafasan manusia
Materi sistem pernafasan manusia
 
Powering front end apps with NServiceBus
Powering front end apps with NServiceBusPowering front end apps with NServiceBus
Powering front end apps with NServiceBus
 
Testamentode Cristo
Testamentode CristoTestamentode Cristo
Testamentode Cristo
 
Las 5 Mejores Playas De Málaga
Las 5 Mejores Playas De MálagaLas 5 Mejores Playas De Málaga
Las 5 Mejores Playas De Málaga
 
Florencia Nieves
Florencia NievesFlorencia Nieves
Florencia Nieves
 
App modernization and evented architectures with Node.js
App modernization and evented architectures with Node.jsApp modernization and evented architectures with Node.js
App modernization and evented architectures with Node.js
 
Making workflow implementation easy with CQRS
Making workflow implementation easy with CQRSMaking workflow implementation easy with CQRS
Making workflow implementation easy with CQRS
 
ReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page ApplicationsReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page Applications
 
Perpres 71 2013_new
Perpres 71 2013_newPerpres 71 2013_new
Perpres 71 2013_new
 
JesúS, Amigo
JesúS, AmigoJesúS, Amigo
JesúS, Amigo
 
“творчий педагог – творчі діти”
“творчий  педагог – творчі діти”“творчий  педагог – творчі діти”
“творчий педагог – творчі діти”
 
Dium Corp A08cas
Dium Corp A08casDium Corp A08cas
Dium Corp A08cas
 
Labuan cermin
Labuan cerminLabuan cermin
Labuan cermin
 
Perlas 1
Perlas 1Perlas 1
Perlas 1
 
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
 
Hiroshima And Nagasaki
Hiroshima And NagasakiHiroshima And Nagasaki
Hiroshima And Nagasaki
 
Iguazu
IguazuIguazu
Iguazu
 
Mutantes
MutantesMutantes
Mutantes
 

Ähnlich wie How to build a Single Page Application (SPA) using HotTowel template in ASP.NET

Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Lou Sacco
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Clarence Ngoh
 
Introduction To Umbraco
Introduction To UmbracoIntroduction To Umbraco
Introduction To UmbracoKen Cenerelli
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010vchircu
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineIMC Institute
 
WinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and ConnectedWinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and ConnectedJeremy Likness
 
Tips and tricks for building Large web applications with Drupal
Tips and tricks for building Large web applications with DrupalTips and tricks for building Large web applications with Drupal
Tips and tricks for building Large web applications with DrupalMitzaCeusan
 
UMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, ChicagoUMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, Chicagobrockfanning
 
Adding a view
Adding a viewAdding a view
Adding a viewNhan Do
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083Divyam Pateriya
 

Ähnlich wie How to build a Single Page Application (SPA) using HotTowel template in ASP.NET (20)

ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)
 
ASP.NET MVC3 RAD
ASP.NET MVC3 RADASP.NET MVC3 RAD
ASP.NET MVC3 RAD
 
Introduction To Umbraco
Introduction To UmbracoIntroduction To Umbraco
Introduction To Umbraco
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
 
Test
TestTest
Test
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
Moving to Drupal
Moving to DrupalMoving to Drupal
Moving to Drupal
 
code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
Synopsis
SynopsisSynopsis
Synopsis
 
WinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and ConnectedWinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and Connected
 
Tips and tricks for building Large web applications with Drupal
Tips and tricks for building Large web applications with DrupalTips and tricks for building Large web applications with Drupal
Tips and tricks for building Large web applications with Drupal
 
UMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, ChicagoUMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, Chicago
 
Adding a view
Adding a viewAdding a view
Adding a view
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
 
Html5
Html5Html5
Html5
 

Kürzlich hochgeladen

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Kürzlich hochgeladen (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

How to build a Single Page Application (SPA) using HotTowel template in ASP.NET

  • 2.  Application contained in only page and all other resource are dynamically loaded in single page container  Some of benefits of it is ◦ You can easily make them compatible with different devices (Such as mobile and web browsers) ◦ Being single page application it has reach user experience and less round tripping to server
  • 3.  Set of library as part of the visual studio template that can be used to SPA  It contains ◦ Durandal(For navigation) ◦ Knockout(For binding) ◦ Breeze(For client side data access) ◦ Toastr (For messages) ◦ Twitter bootstrap(For mobile compatibility and CSS styling)
  • 4.  Download WebTools 2012.2 update http://weblogs.asp.net/scottgu/archive/2013/0 2/18/announcing-release-of-asp-net-and-web- tools-2012-2-update.aspx or Install nuget package for HotTowel  Follow jonh papa’s blog at http://www.johnpapa.net/hottowel/ or go through http://pluralsight.com/training/courses/TableOf Contents?courseName=single-page-apps- jumpstart and download complete plurasight code from https://github.com/johnpapa/PluralsightSpaJum pStartFinal
  • 5. •In HotTowel one can see App folder which contains overall structure of the application and the way it is going to behave • Durandal folder contains navigation logic for viewmodel , view and provide proper mapping between different folder part of the project • Shell.js contains navigation details and project startup events. We can use activate or boot events in order to register startup parameters for the in our SPA or add new pages navigation inside boot function. • Services folder contains various services that we are planning to use throughout our application such as logger.js is already there for showing toaster message. Similarly, we can create services that will talk to our controller for retrieving data •Viewmodels foder will contain JavaScript files where will put logic to bind ui and call services to save data •Views folder will contain html files where we will be putting UI markups
  • 6.  Add new link in navigation (shell.js) router.mapNav('employee');  Add employee.js and employee.html viewmodels and view respectively  Modify content on employee.html and run the application in order to see that the content are reflected properly
  • 7.  Create a model named Employee with Id and Name property  Run Enalbe-Migration command (Enable- Migrations -ContextTypeName HotTowelExample1.Models.EmployeeDBConte xt)  Execute add-migration Initial for creating scripts for database tables  Seed data in Configuration class  Run update-database to populate data with dummy records
  • 8.  Create a Controller in Controller folder and inherit it from ApiController and provide [BreezeController] attribute for class  Implement readonly property for ContextAccess and Metadata() method for consuming it with Breeze  Implement GetEmployees method to return all employees from BreezeController which will be consumed by our client side application
  • 9.  In App/Services crate model.js and datacontext.js files  In datacontex.js implement a function to retreive data  Take object of breeze.EntityQuery for querying breeze controller and configure manager by calling registerEntityTypeCtor on each entity to be used in javascript  This part is written in model.js file  Create function getEmpoyees to retreive and set observable collecton to be used by UI
  • 10.  In ViewModel(employee.js) create file to return observable to be used in view. Include observable as part of return vm as to be consumable with view  Observable array will be passed to data context for loading data and will be set with employeeObservable(data.results)  Use knockout binding to on UI  Tip:() use to evaluate knockout properties
  • 11.  Example for the slide can be found at http://dms.varahitest.in/Example/HotTowelE xample1.zip