building great spa’s with angular js, asp.net mvc and webapi

18
Building great SPA’s with AngularJS, ASP.NET MVC and WebAPI

Upload: maurice-beijer

Post on 09-May-2015

4.649 views

Category:

Software


0 download

DESCRIPTION

Slides from my Techorama 2014 presentation

TRANSCRIPT

Page 1: Building great spa’s with angular js, asp.net mvc and webapi

Building great SPA’s with

AngularJS, ASP.NET MVC and WebAPI

Page 2: Building great spa’s with angular js, asp.net mvc and webapi

2

What are we going to talk about?

• AngularJS• ASP.NET MVC• ASP.NET WebAPI• Single Page Applications

Page 3: Building great spa’s with angular js, asp.net mvc and webapi

3

Who am I?

• Maurice de Beijer• The Problem Solver• Microsoft Integration MVP• Freelance developer• DevelopMentor instructor• Twitter: @mauricedb• Blog: http://msmvps.com/blogs/TheProblemSolver/ • Web: http://www.TheProblemSolver.nl• E-mail: [email protected]

Page 4: Building great spa’s with angular js, asp.net mvc and webapi

4

AngularJS

• Powerful JavaScript MVC framework• Makes it easy to build Single Page Applications• Focused on building CRUD applications• Very modular with Dependency Injection• Makes it relatively easy to build testable

applications

Page 5: Building great spa’s with angular js, asp.net mvc and webapi

5

AngularJS

Page 6: Building great spa’s with angular js, asp.net mvc and webapi

6

AngularJS cons

• Large JavaScript applications are hard to maintain

• Even a browser based application needs a server part

• Doing the same thing in every browser wastes CPU cycles

Page 7: Building great spa’s with angular js, asp.net mvc and webapi

7

AngularJS

Demo

Page 8: Building great spa’s with angular js, asp.net mvc and webapi

8

ASP.NET WebAPI

• Makes it easy to serve up data in a RESTful manner

• Easy to consume from AngularJS– $resource– $http

Page 9: Building great spa’s with angular js, asp.net mvc and webapi

9

ASP.NET WebAPI

Demo

Page 10: Building great spa’s with angular js, asp.net mvc and webapi

10

ASP.NET MVC

• Powerful server side MVC framework– Routing– HTML helpers– Editor templates

Page 11: Building great spa’s with angular js, asp.net mvc and webapi

11

ASP.NET MVC cons

• Doing everything on the server is wasteful– UI lag because of latency– Need to worry about scaling sooner

Page 12: Building great spa’s with angular js, asp.net mvc and webapi

12

Single Page Applications

• SPA’s are great for the end user– Responsive

• SPA’s are great for the server– Only request to the server when needed

Page 13: Building great spa’s with angular js, asp.net mvc and webapi

13

Single Page Applications cons

• SPA’s can be hard to maintain– Less structure out of the box– Hard to maintain when large

Page 14: Building great spa’s with angular js, asp.net mvc and webapi

14

Single Page Applications

Demo

Page 15: Building great spa’s with angular js, asp.net mvc and webapi

15

The best of both worlds

• Mix ASP.NET with Angular– Use the structure of ASP.NET to create Mini SPAs– MVC HTML helpers to reduce markup repetition

Page 16: Building great spa’s with angular js, asp.net mvc and webapi

16

The best of both worlds

Demo

Page 17: Building great spa’s with angular js, asp.net mvc and webapi

17

Questions

?https://github.com/mauricedb/Techorama2014/

Page 18: Building great spa’s with angular js, asp.net mvc and webapi

18

A big thank you to our sponsors

Gold Partners

Silver & Track Partners

Platinum Partners