A Single Page App With Backbone.js, ASP.NET Web API, and F#
Join the DZone community and get the full member experience.
Join For FreeIn this post, I introduce a simple example of a single page application built with Backbone.js, ASP.NET Web API, F#, and more. The example is an overly simple contacts app that allows you to view contacts and create new ones. It uses the Foundation 3 framework for styling and responsive design.
Here's a screenshot of the simple contact list view:
Solution Organization:
The C# project contains the following:
The F# project contains the following:
You can find the full source at https://github.com/dmohl/FsWebSpa-Backbone.
Here's a screenshot of the simple contact list view:
Solution Organization:
The C# project contains the following:
- A single Index.cshtml file.
- All images, CSS, and JavaScript.
- A "Templates" folder that contains 2 .htm files that hold the markup for each view. The templating feature of underscore.js is used to allow placeholders in the templates to be replaced with the desired data.
- The "app" folder contains a main.js, a utility.js, and a file containing route definitions using Backbone.Router.
- The "models" folder contains the Backbone models and collections.
- The "views" folder contains Backbone views.
The F# project contains the following:
- ASP.NET MVC and Web API routes.
- Definitions of JS and CSS bundles.
- ASP.NET MVC and Web API Controllers.
- A Model class.
You can find the full source at https://github.com/dmohl/FsWebSpa-Backbone.
Web API
ASP.NET
app
Backbone.js
Published at DZone with permission of Daniel Mohl, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments