SlideShare a Scribd company logo
Angular on ASP.NET MVC 6
Noam Kfir | Sela Group | 2015
Who Am I
 Noam Kfir
 Senior Architect and Trainer at Sela Group
 Organizer of the Front-End.IL Meetup
 Co-authoring a Microsoft Official Curriculum (MOC) course on ASP.NET MVC 6
 Twitter: @NoamKfir
 Email: noam@kfir.cc or noamkfir@sela.co.il
.NET Today
https://xkcd.com/927/
.NET Fragmentation
 .NET is fragmented across platforms
 Desktop, Phone, Xbox, Store, Compact, Micro, Silverlight, Mono
 Affects deployment, code sharing, APIs, knowledge burden
 Portable Class Libraries
 Target multiple platforms
 Early attempt to solve the problem using contracts
 Not truly cross-platform
 Always incomplete
Angular on ASP.NET MVC 6
.NET Core to the Rescue
 .NET Core is a new universal foundation
 CoreCLR subset of CLR
 CoreFX subset of BCL
 Better JIT compiler (RyuJIT)
 Completely open source (MIT)
 Truly cross-platform (Windows, Linux, OS X)
 Modular!
Angular on ASP.NET MVC 6
ASP.NET 5 at a Glance
 Versions
 ASP.NET 5, ASP.NET MVC 6, Entity Framework 7
 Same abstractions, mostly
 Model, View, Controller, Razor, Web API…
 Completely rewritten infrastructure
 OWIN, DNX, cross-platform, modular, dependency injection
 grunt/gulp, npm/bower, kestrel, custom commands…
DNX Overview
 The .NET Execution Environment
 SDK and cross-platform runtime environment
 Responsible for hosting, managing dependencies and bootstrapping apps
 Wraps NuGet: consumes and creates packages
DNX Projects
 .xproj replaces .csproj
 Language agnostic
 Does not keep track of individual files and folders
 The project.json manifest
 Project info
 Dependencies (NuGet, npm, bower)
 Custom commands
Hello, World!
Let’s build a simple console app
Command Line Tools
 DNU – .NET Development Utility
 Build, package and publish DNX projects
 Essentially manages NuGet packages
 Similar to npm
 DNVM – .NET Version Manager
 Manages runtimes
 Runtimes can be installed side-by-side
 Similar to Node’s nvm, Ruby’s rvm, Python’s virtualenv
ASP.NET Templates
 Empty – start from scratch (mostly)
 Web API – REST APIs without extra overhead
 Web Site – MVC web site (kitchen sink included)
 Database
 Auth
 Build and basic dependencies (gulp, npm, bower, nuget)
 Basic settings and conventions in place
Hello, World Wide Web!
Let’s build a simple web site
Angular on ASP.NET MVC 6
Visual Studio Tooling
 Task Runner Explorer
 Supports grunt, gulp, karma and others
 Web Essentials
 Most features eventually become part of Visual Studio
 Basic Zen coding support
 Introduced support for Less and Sass and other HTML and CSS helpers
 Lots of general improvements, ongoing
 Introduced Angular features, like completion and validation
Angular on ASP.NET MVC 6
Useful Extensions
 SideWaffle
 File templates for Angular, including services, factories, tests, modules, and others
 ReSharper
 Emmet for ReSharper – better Zen coding extension
 AngularJS (for ReSharper 9) – code completion and live templates, official jetBrains extension
 See and easily add live templates using the Template Explorer
Adding Angular
 Bower dependency
 via command line
 with bower.json and completion
 The environment tag helper
 development: simple script element
 production/staging: CDN with fallback to min.js
 Gulp
 Copy from bower_components to wwwroot/lib
Creating Scripts
 Avoid creating files directly in wwwroot
 Write them elsewhere and then copy them over with Gulp
 Makes it easier to add automated minification, concatenation, annotation, CDNification, etc.
 Optionally use a SideWaffle template
 ReSharper live templates are very useful!
Building Up
Let’s add a simple controller with a dependency and ngAnnotate
Consuming APIs
 Web API has been merged with MVC
 Both inherit from Controller
 Both have access to the same infrastructure: routing, action results, caching, etc.
 $resource maps to Web API routes
 Web API returns JSON (by default)
ngResource
Let’s add the angular-resource package and retrieve data from the server
Summary
 ASP.NET 5 has been rewritten almost from scratch
 It is modern, open source and cross-platform
 Deeply integrates with the frontend ecosystem, including gulp, bower and npm
 Visual Studio and select extensions make working with Angular much easier
 MVC 6 with Web API is well-suited to Angular apps

More Related Content

PPTX
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
Syed Shanu
 
PPTX
MVC 6 Introduction
Sudhakar Sharma
 
PPTX
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Aaron Jacobson
 
PPTX
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
PPTX
Learning ASP.NET 5 and MVC 6
Ido Flatow
 
PPTX
Introduction of ASP.NET MVC and AngularJS
Mohamed Elkhodary
 
PPTX
Introduction to ASP.NET MVC
Khaled Musaied
 
PPTX
Introducing ASP.NET Core 2.0
Steven Smith
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
Syed Shanu
 
MVC 6 Introduction
Sudhakar Sharma
 
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Aaron Jacobson
 
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
Learning ASP.NET 5 and MVC 6
Ido Flatow
 
Introduction of ASP.NET MVC and AngularJS
Mohamed Elkhodary
 
Introduction to ASP.NET MVC
Khaled Musaied
 
Introducing ASP.NET Core 2.0
Steven Smith
 

What's hot (20)

PPTX
ASP .NET MVC
eldorina
 
PPTX
ASP.NET Brief History
Sudhakar Sharma
 
PPTX
MVC - Introduction
Sudhakar Sharma
 
PPTX
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
PPT
ASP.NET MVC Presentation
ivpol
 
PPTX
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
PPTX
Web api
Sudhakar Sharma
 
PPTX
Asp.net MVC training session
Hrichi Mohamed
 
PPTX
AngularJS Scopes
Mohamed Elkhodary
 
PDF
ASP.NET MVC 3
Buu Nguyen
 
PPTX
Introduction to ASP.NET
Peter Gfader
 
PPT
ASP .net MVC
Divya Sharma
 
PPTX
Modern Applications With Asp.net Core 5 and Vue JS 3
Alexandre Malavasi
 
PDF
From MEAN to the MERN Stack
Troy Miles
 
PPT
Intro to SPA using JavaScript & ASP.NET
Alan Hecht
 
PPTX
ASP.NET Core 1.0
Ido Flatow
 
PPTX
Unpacking .NET Core | EastBanc Technologies
EastBanc Tachnologies
 
PDF
Asp.Net Core MVC , Razor page , Entity Framework Core
mohamed elshafey
 
PPTX
ASP .NET MVC - best practices
Bohdan Pashkovskyi
 
PPTX
ASP.NET 5 Overview: Post RTM
Shahed Chowdhuri
 
ASP .NET MVC
eldorina
 
ASP.NET Brief History
Sudhakar Sharma
 
MVC - Introduction
Sudhakar Sharma
 
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
ASP.NET MVC Presentation
ivpol
 
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
Asp.net MVC training session
Hrichi Mohamed
 
AngularJS Scopes
Mohamed Elkhodary
 
ASP.NET MVC 3
Buu Nguyen
 
Introduction to ASP.NET
Peter Gfader
 
ASP .net MVC
Divya Sharma
 
Modern Applications With Asp.net Core 5 and Vue JS 3
Alexandre Malavasi
 
From MEAN to the MERN Stack
Troy Miles
 
Intro to SPA using JavaScript & ASP.NET
Alan Hecht
 
ASP.NET Core 1.0
Ido Flatow
 
Unpacking .NET Core | EastBanc Technologies
EastBanc Tachnologies
 
Asp.Net Core MVC , Razor page , Entity Framework Core
mohamed elshafey
 
ASP .NET MVC - best practices
Bohdan Pashkovskyi
 
ASP.NET 5 Overview: Post RTM
Shahed Chowdhuri
 
Ad

Similar to Angular on ASP.NET MVC 6 (20)

PDF
Pottnet MeetUp Essen - ASP.Net Core
Malte Lantin
 
PDF
Pottnet Meetup Essen - ASP.Net Core
Malte Lantin
 
PPTX
Short-Training asp.net vNext
Betclic Everest Group Tech Team
 
PPTX
Best of Microsoft Dev Camp 2015
Bluegrass Digital
 
PDF
Angular - Chapter 1 - Introduction
WebStackAcademy
 
PDF
Dot NET Core Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
.Net Core
Bohdan Pashkovskyi
 
PPTX
Building Applications With the MEAN Stack
Nir Noy
 
PPTX
Project K, Vnext and Owin
Hrvoje Hudoletnjak
 
PPTX
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
PPTX
ASP.NET Core: The best of the new bits
Ken Cenerelli
 
PDF
Node.js Web Development .pdf
Abanti Aazmin
 
PPTX
Getting Started with ASP.NET vNext
Lohith Goudagere Nagaraj
 
PPTX
Beginners Node.js
Khaled Mosharraf
 
PDF
Javascript Client & Server Architectures
Pedro Melo Pereira
 
PPTX
Cloud development technology sharing (BlueMix premier)
湯米吳 Tommy Wu
 
PDF
【BS1】What’s new in visual studio 2022 and c# 10
日本マイクロソフト株式会社
 
PDF
The path to a serverless-native era with Kubernetes
sparkfabrik
 
Pottnet MeetUp Essen - ASP.Net Core
Malte Lantin
 
Pottnet Meetup Essen - ASP.Net Core
Malte Lantin
 
Short-Training asp.net vNext
Betclic Everest Group Tech Team
 
Best of Microsoft Dev Camp 2015
Bluegrass Digital
 
Angular - Chapter 1 - Introduction
WebStackAcademy
 
Dot NET Core Interview Questions PDF By ScholarHat
Scholarhat
 
Building Applications With the MEAN Stack
Nir Noy
 
Project K, Vnext and Owin
Hrvoje Hudoletnjak
 
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
ASP.NET Core: The best of the new bits
Ken Cenerelli
 
Node.js Web Development .pdf
Abanti Aazmin
 
Getting Started with ASP.NET vNext
Lohith Goudagere Nagaraj
 
Beginners Node.js
Khaled Mosharraf
 
Javascript Client & Server Architectures
Pedro Melo Pereira
 
Cloud development technology sharing (BlueMix premier)
湯米吳 Tommy Wu
 
【BS1】What’s new in visual studio 2022 and c# 10
日本マイクロソフト株式会社
 
The path to a serverless-native era with Kubernetes
sparkfabrik
 
Ad

More from Noam Kfir (16)

PPTX
Agile Mind Games and the Art of Self-Delusion
Noam Kfir
 
PPTX
Testers and Coders - Blurring the Lines
Noam Kfir
 
PPTX
TDD and the Legacy Code Black Hole
Noam Kfir
 
PPTX
TypeScript Modules
Noam Kfir
 
PPTX
There Is No JavaScript
Noam Kfir
 
PPTX
Meteor
Noam Kfir
 
PPTX
Clean code
Noam Kfir
 
PPTX
Maximizing UI Automation – A Case Study
Noam Kfir
 
PPTX
Web components
Noam Kfir
 
PPTX
HTML5 and the Evolution of the Web
Noam Kfir
 
PPTX
Git Workflows
Noam Kfir
 
PPTX
Getting Started with Git: A Primer for SVN and TFS Users
Noam Kfir
 
PPTX
Building Cross-Platform JavaScript Apps using Cordova
Noam Kfir
 
PPTX
Telerik Platform
Noam Kfir
 
PPTX
Profiling JavaScript Performance
Noam Kfir
 
PPTX
Drawing in HTML5 Open House
Noam Kfir
 
Agile Mind Games and the Art of Self-Delusion
Noam Kfir
 
Testers and Coders - Blurring the Lines
Noam Kfir
 
TDD and the Legacy Code Black Hole
Noam Kfir
 
TypeScript Modules
Noam Kfir
 
There Is No JavaScript
Noam Kfir
 
Meteor
Noam Kfir
 
Clean code
Noam Kfir
 
Maximizing UI Automation – A Case Study
Noam Kfir
 
Web components
Noam Kfir
 
HTML5 and the Evolution of the Web
Noam Kfir
 
Git Workflows
Noam Kfir
 
Getting Started with Git: A Primer for SVN and TFS Users
Noam Kfir
 
Building Cross-Platform JavaScript Apps using Cordova
Noam Kfir
 
Telerik Platform
Noam Kfir
 
Profiling JavaScript Performance
Noam Kfir
 
Drawing in HTML5 Open House
Noam Kfir
 

Recently uploaded (20)

PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Presentation about variables and constant.pptx
safalsingh810
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 

Angular on ASP.NET MVC 6

  • 1. Angular on ASP.NET MVC 6 Noam Kfir | Sela Group | 2015
  • 2. Who Am I  Noam Kfir  Senior Architect and Trainer at Sela Group  Organizer of the Front-End.IL Meetup  Co-authoring a Microsoft Official Curriculum (MOC) course on ASP.NET MVC 6  Twitter: @NoamKfir  Email: [email protected] or [email protected]
  • 4. .NET Fragmentation  .NET is fragmented across platforms  Desktop, Phone, Xbox, Store, Compact, Micro, Silverlight, Mono  Affects deployment, code sharing, APIs, knowledge burden  Portable Class Libraries  Target multiple platforms  Early attempt to solve the problem using contracts  Not truly cross-platform  Always incomplete
  • 6. .NET Core to the Rescue  .NET Core is a new universal foundation  CoreCLR subset of CLR  CoreFX subset of BCL  Better JIT compiler (RyuJIT)  Completely open source (MIT)  Truly cross-platform (Windows, Linux, OS X)  Modular!
  • 8. ASP.NET 5 at a Glance  Versions  ASP.NET 5, ASP.NET MVC 6, Entity Framework 7  Same abstractions, mostly  Model, View, Controller, Razor, Web API…  Completely rewritten infrastructure  OWIN, DNX, cross-platform, modular, dependency injection  grunt/gulp, npm/bower, kestrel, custom commands…
  • 9. DNX Overview  The .NET Execution Environment  SDK and cross-platform runtime environment  Responsible for hosting, managing dependencies and bootstrapping apps  Wraps NuGet: consumes and creates packages
  • 10. DNX Projects  .xproj replaces .csproj  Language agnostic  Does not keep track of individual files and folders  The project.json manifest  Project info  Dependencies (NuGet, npm, bower)  Custom commands
  • 11. Hello, World! Let’s build a simple console app
  • 12. Command Line Tools  DNU – .NET Development Utility  Build, package and publish DNX projects  Essentially manages NuGet packages  Similar to npm  DNVM – .NET Version Manager  Manages runtimes  Runtimes can be installed side-by-side  Similar to Node’s nvm, Ruby’s rvm, Python’s virtualenv
  • 13. ASP.NET Templates  Empty – start from scratch (mostly)  Web API – REST APIs without extra overhead  Web Site – MVC web site (kitchen sink included)  Database  Auth  Build and basic dependencies (gulp, npm, bower, nuget)  Basic settings and conventions in place
  • 14. Hello, World Wide Web! Let’s build a simple web site
  • 16. Visual Studio Tooling  Task Runner Explorer  Supports grunt, gulp, karma and others  Web Essentials  Most features eventually become part of Visual Studio  Basic Zen coding support  Introduced support for Less and Sass and other HTML and CSS helpers  Lots of general improvements, ongoing  Introduced Angular features, like completion and validation
  • 18. Useful Extensions  SideWaffle  File templates for Angular, including services, factories, tests, modules, and others  ReSharper  Emmet for ReSharper – better Zen coding extension  AngularJS (for ReSharper 9) – code completion and live templates, official jetBrains extension  See and easily add live templates using the Template Explorer
  • 19. Adding Angular  Bower dependency  via command line  with bower.json and completion  The environment tag helper  development: simple script element  production/staging: CDN with fallback to min.js  Gulp  Copy from bower_components to wwwroot/lib
  • 20. Creating Scripts  Avoid creating files directly in wwwroot  Write them elsewhere and then copy them over with Gulp  Makes it easier to add automated minification, concatenation, annotation, CDNification, etc.  Optionally use a SideWaffle template  ReSharper live templates are very useful!
  • 21. Building Up Let’s add a simple controller with a dependency and ngAnnotate
  • 22. Consuming APIs  Web API has been merged with MVC  Both inherit from Controller  Both have access to the same infrastructure: routing, action results, caching, etc.  $resource maps to Web API routes  Web API returns JSON (by default)
  • 23. ngResource Let’s add the angular-resource package and retrieve data from the server
  • 24. Summary  ASP.NET 5 has been rewritten almost from scratch  It is modern, open source and cross-platform  Deeply integrates with the frontend ecosystem, including gulp, bower and npm  Visual Studio and select extensions make working with Angular much easier  MVC 6 with Web API is well-suited to Angular apps