Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Angular2 with ASP.NET Core
Search
David M Pine
April 07, 2017
Programming
57
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Angular2 with ASP.NET Core
David M Pine
April 07, 2017
More Decks by David M Pine
See All by David M Pine
You don't need glasses to C#
ievangelist
1
87
2016 //build/ recap
ievangelist
0
43
Other Decks in Programming
See All in Programming
不幸な GC
chencmd
0
880
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
3
340
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
420
Building an Out-of-Order CPU
latte72
0
700
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
990
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.9k
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
54
36k
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
140
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
340
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
0
410
信頼性の目標を誰も求めてない
shubox
0
490
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
490
GitHub's CSS Performance
jonrohan
1033
470k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Tell your own story through comics
letsgokoyo
1
1.1k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Transcript
ANGUL AR2 WITH AN ASP.NET CORE BACKEND, HAPPINESS ENSUES... B
Y DAV I D P I N E
AGENDA • Introduction • Set the stage • Angular2 •
ASP.NET Core • The “I Do’s” – marriage ceremony • Question & Answers
DAVID PINE { @davidpine7 } < TECHNICAL EVANGELIST /> •
http://davidpine.net • https://github.com/ievangelist • http://stackoverflow.com/users/2410379/david-pine • https://www.linkedin.com/in/dpine
SET THE STAGE T H E WO R L D
- W I D E W E B ? !
LEGACY WEB HyperText Markup Language [ HTML, 1993 ] Cascading
Style Sheets [ CSS, 1996 ] JavaScript [ JS, 1995 ] Originally designed to serve as a static document. Applications were typically a few hundred lines at most…
DEAD-TO-ME WEB ASP.NET Proper • WebForms – ViewState, Page Lifecycle,
Postbacks, HTML abstraction, etc… • MVC – System.Web, Global mutable state, Page Load/Request, API vs MVC
THINGS THEY GOT RIGHT MVC • Testable • Separation of
concerns • Stateless • HTTP verbs • CSHTML (somewhat) WEBFORMS
MODERN WEB / ARCHITECTURE Single Page Application [ SPA, 2003
] • Initial page load is a drag… ¯\_(ツ)_/¯ • Client-side routing • Full control over HTML • Closer to the problem domain (web dev)
OF APPROVAL ANGULAR Is built with TypeScript VISUAL STUDIO CODE
Is built with Chromium
None
OPEN SOURCE Angular –https://github.com/angular TypeScript –https://github.com/microsoft/typescript ASP.NET Core –https://github.com/aspnet
OPEN SOURCE watch branch compare code commit pull request merge
star
ANGULAR (2+) N OT A N G U L A
R J S ( 1 + )
ANGULAR •Modules •Components •Pipes •Templating
Angular Modules help organize an application into cohesive blocks of
functionality. app.module.ts MODULES
import { NgModule } from '@angular/core'; import { RouterModule }
from '@angular/router'; import { UniversalModule } from 'angular2-universal'; import { AppComponent } from './components/app/app.component‘ import { HomeComponent } from './components/home/home.component'; @NgModule({ bootstrap: [ AppComponent ], declarations: [ AppComponent, HomeComponent ], imports: [ UniversalModule, // Imports BrowserModule, HttpModule, and JsonpModule RouterModule.forRoot([ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', component: HomeComponent }, { path: '**', redirectTo: 'home' } ]) ] }) export class AppModule { }
Angular Component are the most basic building block of an
UI in an Angular application. app.component.ts COMPONENTS
import { Component } from '@angular/core'; @Component({ selector: 'home', templateUrl:
'./home.component.html' }) export class HomeComponent { } <div> <home></home> </div> Component Class Impl Example Usage
Angular Pipes transform displayed values within a template. datetime.pipe.ts PIPES
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: date'
}) export class DatePipe implements PipeTransform { transform(date: Date, format?: string): string { // Omitted for brevity ... } } <div> {{ dateOfBirth | date:shortDate }} // Outputs as 7/7/1984 </div> Pipe Class Impl Example Usage
Angular Templates in Angular, the component plays the part of
the controller/viewmodel, and the template represents the view. home.component.html TEMPLATING
HTML Plus Interpolation ( {{...}} ) Template expressions Template statements
Binding syntax Property binding ( [property] ) Attribute, class, and style bindings Event binding ( (event) ) Two-way data binding ( [(...)] ) Built-in directives Built-in attribute directives NgClass NgStyle NgModel ([(ngModel)]) Built-in structural directives NgIf NgFor Template input variables Microsyntax The NgSwitch directives Template reference variables ( #var ) Input and output properties ( @Input and @Output ) Template expression operators pipe ( | ) safe navigation operator ( ?. )
ASP.NET CORE N OT A S P. N E T
5
ASP.NET CORE • Middleware • Dependency Injection • Strongly-typed Config
• Logging • Web API • C#
PUTTING IT ALL TOGETHER Azure DocumentDb (Data Store) ASP.NET Core
(Web Server) Angular (Clients)
DEMO (ALL THE THINGS) – “I DO’S”
{ THANK YOU } < source code /> https://github.com/ievangelist/IEvangelist.Angular