SlideShare a Scribd company logo
1 of 24
The Zen of Angular
Developments
Angular GDE / Microsoft MVP / Microsoft RD
Will Huang
http://blog.miniasp.com/
Angular Vienna Meetup
Will 保哥 (Will Huang)
• Founder of Duotify Inc. (Taiwan)
• Core Member of Angular Taiwan User Group
• 2018 ~ Now | Angular/Web GDE (Google Developer Expert)
• 2008 ~ Now | Microsoft MVP / Microsoft RD
• Blogger / YouTuber / Instructor / Consultant / Organizer
Angular Dev Citta
Concept first, then Speed
Angular Vienna Meetup
Concept First
• Angular Bootstrap Process
• Angular Execution Lifecycle
• Angular Forms
• Angular Routers
• Angular Components
• Third-party components
• State Managements
• Performance Tuning
• Unit testing & Integration tests
• Modules & Libraries
Angular Vienna Meetup
Then Speed
• Blind typing / Speed typing
• Accuracy first, then speed
• Mastering your dev tools
• Don't "type" if you don't have to
• Control the "Flow" state
• Eliminate all the distraction from your mind
Angular CLI
The extreme tool that improve your dev env.
Angular Vienna Meetup
Using Schematics for automation
• ng new demo1 --routing --style css
• ng generate component hello
• ng update
• Build your own code generation
• A great sample/tutorial from Manfred Steyer's Angular CRUD
• ng g angular-crud:crud-module hotel
• ng add @angular/elements
• ng add @angular/material
• ng add @angular/pwa
• ng add @clr/angular
• ng add @nativescript/schematics
• ng add ng-zorro-antd
• ng add ngcli-wallaby
Angular Vienna Meetup
Interactive ng new / ng add / ng generate
ng new demo1 --routing --style css
Angular Vienna Meetup
ng add @angular/material
Angular Vienna Meetup
Keep your Angular apps evergreen
• https://update.angular.io/
• Migrating outdated RxJS syntax
npm install -g rxjs-tslint
rxjs-5-to-6-migrate -p src/tsconfig.app.json
npm uninstall rxjs-compat
• Upgrade to latest Angular version
npm install @angular/cli
ng update @angular/cli @angular/core
ng update @angular/material
Angular Vienna Meetup
Updating to Angular 9 (a.k.a. Ivy)
• Upgrade ( https://next.angular.io/guide/updating-to-version-9 )
• ng update @angular/core@8 @angular/cli@8
• ng update @angular/cli @angular/core --next
• ng update @angular/material --next
• New
• npx @angular/cli@next new demo9 --routing --style css
Visual Studio Code
The best Angular development tool
Angular Vienna Meetup
Code Navigation
• Don't use EXPLORER anymore in Visual Studio Code
• Always use Ctrl+E to find files ( Command: workbench.action.quickOpen )
• Fuzzy matching
• Navigating back and forward
• Back:Alt+ ( Command: workbench.action.navigateBack )
• Forward:Alt+ ( Command: workbench.action.navigateForward )
• Breadcrumbs
• Toggle On: Ctrl+Shift+. ( Command: breadcrumbs.toggleToOn )
• Focus Previous: Ctrl+ ( Command: breadcrumbs.focusPrevious )
• Focus Next: Ctrl+ ( Command: breadcrumbs.focusNext )
Angular Vienna Meetup
Angular Extension Pack
• You MUST install Angular Extension Pack extension
Angular Vienna Meetup
Angular Language Service
• Completions lists
• AOT Diagnostic messages
• Quick info
• Go to definition
Angular Vienna Meetup
• Switch to TEMPLATE ( *.html )
• Shoftcut:alt+o (Windows) / shift+alt+o (macOS)
• Switch to CSS ( *.css )
• Shortcut:alt+i (Windows) / shift+alt+i (macOS)
• Switch to TypeScript ( *.ts )
• Shortcut:alt+u (Windows) / shift+alt+u (macOS)
• Switch to Spec file ( *.spec.ts )
• Shortcut:alt+p (Windows) / shift+alt+p (macOS)
Switching between files in a component
Angular Vienna Meetup
Use Code Snippets
• Use Code Snippets as much as you can
• ng-import-* import common Angular modules or services
• a-* Angular Snippets
• ng-* Angular Snippets
• ngrx-* Angular NgRx Snippets
• ngxs-* Angular Ngxs Snippets
• m-* Angular Material Design Snippets
• rx-* RxJS Snippets for both TypeScript and JavaScript
Angular Vienna Meetup
Use TSLint to improve code quality
• Command
• TSLint: Fix all auto-fixable problems ( Command: tslint.fixAllProblems )
• TSLint core rules ( tslint.json )
• import-blacklist
• prefer-const
• Fix all auto-fixable problems when on save (VSCode Settings)
"editor.codeActionsOnSave": {
"source.fixAll.tslint": true
}
Angular Vienna Meetup
TypeScript Refactoring
• Code Actions = Quick Fixes
• Ctrl+.
• Rename symbol
• F2
• Change All Occurrences
• Ctrl+F2 / CMD+F2
• Move TS
• Move TypeScript files and update
relative imports
• Refactoring actions
• Extract Method
• Extract Variable
• Extract function
• Extract constant
• Suggestion Code Action ( ... )
• Generate 'get' and 'set' accessors
• Move to new file
• Convert to async function
• Convert between named imports and namespace imports
Angular Vienna Meetup
TypeScript type definition
• JSON to TS
• Ctrl+Alt+V Convert from clipboard
• Ctrl+Alt+S Convert from selection
• Paste JSON as Code
• Support TypeScript, Python, Go, Ruby, C#, Java, Swift, Rust, Kotlin, C++, Flow, Objective-C,
JavaScript, Elm, and JSON Schema
• Choose Language Mode first, then run "Paste JSON as Code/Type" Command
• Paste JSON as Code ( Command: quicktype.pasteJSONAsTypesAndSerialization )
• Paste JSON as Type ( Command: quicktype.pasteJSONAsTypes )
Angular Vienna Meetup
• Document This
• Just hit Ctrl+Alt+D twice
Auto-generate code comments
Angular Vienna Meetup
• https://angular.io/guide/styleguide
• If you have time, read it.
• If you don't have time, forget it.
• Just let ng generate scaffold the code for you.
• Just run ng lint to check the code styles ( codelyzer )
• Just use TSLint to "Fix all auto-fixable problems"
Following the Angular Style Guide
Angular Vienna Meetup
Links
• Angular Extension Pack - Visual Studio Marketplace
• TSLint - Visual Studio Marketplace
• Angular CLI Command Reference
• Angular Update Guide
• Angular Style Guide
THANK YOU

More Related Content

More from Will Huang

從實戰經驗看到的 K8S 導入痛點
從實戰經驗看到的 K8S 導入痛點從實戰經驗看到的 K8S 導入痛點
從實戰經驗看到的 K8S 導入痛點Will Huang
 
RxJS 6 新手入門
RxJS 6 新手入門RxJS 6 新手入門
RxJS 6 新手入門Will Huang
 
极速 Angular 开发:效能调校技巧 (ngChina 2019)
极速 Angular 开发:效能调校技巧 (ngChina 2019)极速 Angular 开发:效能调校技巧 (ngChina 2019)
极速 Angular 开发:效能调校技巧 (ngChina 2019)Will Huang
 
你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)
你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)
你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)Will Huang
 
Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Will Huang
 
邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)
邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)
邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)Will Huang
 
Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Will Huang
 
Angular 7 全新功能探索 (Angular Taiwan 2018)
Angular 7 全新功能探索 (Angular Taiwan 2018)Angular 7 全新功能探索 (Angular Taiwan 2018)
Angular 7 全新功能探索 (Angular Taiwan 2018)Will Huang
 
利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)
利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)
利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)Will Huang
 
AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)Will Huang
 
使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)
使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)
使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)Will Huang
 
全新 Windows Server 2019 容器技術 及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)
全新 Windows Server 2019 容器技術及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)全新 Windows Server 2019 容器技術及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)
全新 Windows Server 2019 容器技術 及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)Will Huang
 
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)Will Huang
 
以敏捷架構打造美國軟體外包專案的經驗談
以敏捷架構打造美國軟體外包專案的經驗談以敏捷架構打造美國軟體外包專案的經驗談
以敏捷架構打造美國軟體外包專案的經驗談Will Huang
 
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018Will Huang
 
迎接嶄新的Windows容器叢集架構:Kubernetes
迎接嶄新的Windows容器叢集架構:Kubernetes迎接嶄新的Windows容器叢集架構:Kubernetes
迎接嶄新的Windows容器叢集架構:KubernetesWill Huang
 
TypeScript 綜合格鬥技
TypeScript 綜合格鬥技TypeScript 綜合格鬥技
TypeScript 綜合格鬥技Will Huang
 
Angular 5 全新功能探索 @ JSDC2017
Angular 5 全新功能探索 @ JSDC2017Angular 5 全新功能探索 @ JSDC2017
Angular 5 全新功能探索 @ JSDC2017Will Huang
 
Windows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, KubernetesWindows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, KubernetesWill Huang
 
Angular 4 新手入門攻略完全制霸
Angular 4 新手入門攻略完全制霸Angular 4 新手入門攻略完全制霸
Angular 4 新手入門攻略完全制霸Will Huang
 

More from Will Huang (20)

從實戰經驗看到的 K8S 導入痛點
從實戰經驗看到的 K8S 導入痛點從實戰經驗看到的 K8S 導入痛點
從實戰經驗看到的 K8S 導入痛點
 
RxJS 6 新手入門
RxJS 6 新手入門RxJS 6 新手入門
RxJS 6 新手入門
 
极速 Angular 开发:效能调校技巧 (ngChina 2019)
极速 Angular 开发:效能调校技巧 (ngChina 2019)极速 Angular 开发:效能调校技巧 (ngChina 2019)
极速 Angular 开发:效能调校技巧 (ngChina 2019)
 
你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)
你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)
你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)
 
Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)
 
邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)
邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)
邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)
 
Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)
 
Angular 7 全新功能探索 (Angular Taiwan 2018)
Angular 7 全新功能探索 (Angular Taiwan 2018)Angular 7 全新功能探索 (Angular Taiwan 2018)
Angular 7 全新功能探索 (Angular Taiwan 2018)
 
利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)
利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)
利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)
 
AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)
 
使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)
使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)
使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)
 
全新 Windows Server 2019 容器技術 及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)
全新 Windows Server 2019 容器技術及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)全新 Windows Server 2019 容器技術及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)
全新 Windows Server 2019 容器技術 及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)
 
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
 
以敏捷架構打造美國軟體外包專案的經驗談
以敏捷架構打造美國軟體外包專案的經驗談以敏捷架構打造美國軟體外包專案的經驗談
以敏捷架構打造美國軟體外包專案的經驗談
 
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
 
迎接嶄新的Windows容器叢集架構:Kubernetes
迎接嶄新的Windows容器叢集架構:Kubernetes迎接嶄新的Windows容器叢集架構:Kubernetes
迎接嶄新的Windows容器叢集架構:Kubernetes
 
TypeScript 綜合格鬥技
TypeScript 綜合格鬥技TypeScript 綜合格鬥技
TypeScript 綜合格鬥技
 
Angular 5 全新功能探索 @ JSDC2017
Angular 5 全新功能探索 @ JSDC2017Angular 5 全新功能探索 @ JSDC2017
Angular 5 全新功能探索 @ JSDC2017
 
Windows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, KubernetesWindows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, Kubernetes
 
Angular 4 新手入門攻略完全制霸
Angular 4 新手入門攻略完全制霸Angular 4 新手入門攻略完全制霸
Angular 4 新手入門攻略完全制霸
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
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
 
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
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
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
 
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
 

The Zen of Angular Developments (Angular Vienna Meetup)

  • 1. The Zen of Angular Developments Angular GDE / Microsoft MVP / Microsoft RD Will Huang http://blog.miniasp.com/
  • 2. Angular Vienna Meetup Will 保哥 (Will Huang) • Founder of Duotify Inc. (Taiwan) • Core Member of Angular Taiwan User Group • 2018 ~ Now | Angular/Web GDE (Google Developer Expert) • 2008 ~ Now | Microsoft MVP / Microsoft RD • Blogger / YouTuber / Instructor / Consultant / Organizer
  • 3. Angular Dev Citta Concept first, then Speed
  • 4. Angular Vienna Meetup Concept First • Angular Bootstrap Process • Angular Execution Lifecycle • Angular Forms • Angular Routers • Angular Components • Third-party components • State Managements • Performance Tuning • Unit testing & Integration tests • Modules & Libraries
  • 5. Angular Vienna Meetup Then Speed • Blind typing / Speed typing • Accuracy first, then speed • Mastering your dev tools • Don't "type" if you don't have to • Control the "Flow" state • Eliminate all the distraction from your mind
  • 6. Angular CLI The extreme tool that improve your dev env.
  • 7. Angular Vienna Meetup Using Schematics for automation • ng new demo1 --routing --style css • ng generate component hello • ng update • Build your own code generation • A great sample/tutorial from Manfred Steyer's Angular CRUD • ng g angular-crud:crud-module hotel • ng add @angular/elements • ng add @angular/material • ng add @angular/pwa • ng add @clr/angular • ng add @nativescript/schematics • ng add ng-zorro-antd • ng add ngcli-wallaby
  • 8. Angular Vienna Meetup Interactive ng new / ng add / ng generate ng new demo1 --routing --style css
  • 9. Angular Vienna Meetup ng add @angular/material
  • 10. Angular Vienna Meetup Keep your Angular apps evergreen • https://update.angular.io/ • Migrating outdated RxJS syntax npm install -g rxjs-tslint rxjs-5-to-6-migrate -p src/tsconfig.app.json npm uninstall rxjs-compat • Upgrade to latest Angular version npm install @angular/cli ng update @angular/cli @angular/core ng update @angular/material
  • 11. Angular Vienna Meetup Updating to Angular 9 (a.k.a. Ivy) • Upgrade ( https://next.angular.io/guide/updating-to-version-9 ) • ng update @angular/core@8 @angular/cli@8 • ng update @angular/cli @angular/core --next • ng update @angular/material --next • New • npx @angular/cli@next new demo9 --routing --style css
  • 12. Visual Studio Code The best Angular development tool
  • 13. Angular Vienna Meetup Code Navigation • Don't use EXPLORER anymore in Visual Studio Code • Always use Ctrl+E to find files ( Command: workbench.action.quickOpen ) • Fuzzy matching • Navigating back and forward • Back:Alt+ ( Command: workbench.action.navigateBack ) • Forward:Alt+ ( Command: workbench.action.navigateForward ) • Breadcrumbs • Toggle On: Ctrl+Shift+. ( Command: breadcrumbs.toggleToOn ) • Focus Previous: Ctrl+ ( Command: breadcrumbs.focusPrevious ) • Focus Next: Ctrl+ ( Command: breadcrumbs.focusNext )
  • 14. Angular Vienna Meetup Angular Extension Pack • You MUST install Angular Extension Pack extension
  • 15. Angular Vienna Meetup Angular Language Service • Completions lists • AOT Diagnostic messages • Quick info • Go to definition
  • 16. Angular Vienna Meetup • Switch to TEMPLATE ( *.html ) • Shoftcut:alt+o (Windows) / shift+alt+o (macOS) • Switch to CSS ( *.css ) • Shortcut:alt+i (Windows) / shift+alt+i (macOS) • Switch to TypeScript ( *.ts ) • Shortcut:alt+u (Windows) / shift+alt+u (macOS) • Switch to Spec file ( *.spec.ts ) • Shortcut:alt+p (Windows) / shift+alt+p (macOS) Switching between files in a component
  • 17. Angular Vienna Meetup Use Code Snippets • Use Code Snippets as much as you can • ng-import-* import common Angular modules or services • a-* Angular Snippets • ng-* Angular Snippets • ngrx-* Angular NgRx Snippets • ngxs-* Angular Ngxs Snippets • m-* Angular Material Design Snippets • rx-* RxJS Snippets for both TypeScript and JavaScript
  • 18. Angular Vienna Meetup Use TSLint to improve code quality • Command • TSLint: Fix all auto-fixable problems ( Command: tslint.fixAllProblems ) • TSLint core rules ( tslint.json ) • import-blacklist • prefer-const • Fix all auto-fixable problems when on save (VSCode Settings) "editor.codeActionsOnSave": { "source.fixAll.tslint": true }
  • 19. Angular Vienna Meetup TypeScript Refactoring • Code Actions = Quick Fixes • Ctrl+. • Rename symbol • F2 • Change All Occurrences • Ctrl+F2 / CMD+F2 • Move TS • Move TypeScript files and update relative imports • Refactoring actions • Extract Method • Extract Variable • Extract function • Extract constant • Suggestion Code Action ( ... ) • Generate 'get' and 'set' accessors • Move to new file • Convert to async function • Convert between named imports and namespace imports
  • 20. Angular Vienna Meetup TypeScript type definition • JSON to TS • Ctrl+Alt+V Convert from clipboard • Ctrl+Alt+S Convert from selection • Paste JSON as Code • Support TypeScript, Python, Go, Ruby, C#, Java, Swift, Rust, Kotlin, C++, Flow, Objective-C, JavaScript, Elm, and JSON Schema • Choose Language Mode first, then run "Paste JSON as Code/Type" Command • Paste JSON as Code ( Command: quicktype.pasteJSONAsTypesAndSerialization ) • Paste JSON as Type ( Command: quicktype.pasteJSONAsTypes )
  • 21. Angular Vienna Meetup • Document This • Just hit Ctrl+Alt+D twice Auto-generate code comments
  • 22. Angular Vienna Meetup • https://angular.io/guide/styleguide • If you have time, read it. • If you don't have time, forget it. • Just let ng generate scaffold the code for you. • Just run ng lint to check the code styles ( codelyzer ) • Just use TSLint to "Fix all auto-fixable problems" Following the Angular Style Guide
  • 23. Angular Vienna Meetup Links • Angular Extension Pack - Visual Studio Marketplace • TSLint - Visual Studio Marketplace • Angular CLI Command Reference • Angular Update Guide • Angular Style Guide

Editor's Notes

  1. Try latest Angular CLI Beta / RC, with Angular v7 and the new Ivy compiler, no install required thanks to npm and npx https://www.gurustop.net/blog/2018/10/11/4258/npm-npx-angular-beta-rc-next-angular-cli-ivy-compiler
  2. Try latest Angular CLI Beta / RC, with Angular v7 and the new Ivy compiler, no install required thanks to npm and npx https://www.gurustop.net/blog/2018/10/11/4258/npm-npx-angular-beta-rc-next-angular-cli-ivy-compiler
  3. https://pixabay.com/zh/%E5%A5%B3%E5%AD%90-%E6%9E%84%E6%88%90-%E7%94%B5%E5%AD%90%E5%AD%A6%E4%B9%A0-%E5%A5%B3%E6%80%A7-%E5%A5%B3%E5%AD%A9-%E4%BA%BA-%E9%AB%98%E5%8A%A0%E7%B4%A2-%E5%85%B4%E5%A5%8B-1401616/
  4. https://pixabay.com/zh/%E5%A5%B3%E5%AD%90-%E6%9E%84%E6%88%90-%E7%94%B5%E5%AD%90%E5%AD%A6%E4%B9%A0-%E5%A5%B3%E6%80%A7-%E5%A5%B3%E5%AD%A9-%E4%BA%BA-%E9%AB%98%E5%8A%A0%E7%B4%A2-%E5%85%B4%E5%A5%8B-1401616/
  5. https://pixabay.com/zh/%E5%A5%B3%E5%AD%90-%E6%9E%84%E6%88%90-%E7%94%B5%E5%AD%90%E5%AD%A6%E4%B9%A0-%E5%A5%B3%E6%80%A7-%E5%A5%B3%E5%AD%A9-%E4%BA%BA-%E9%AB%98%E5%8A%A0%E7%B4%A2-%E5%85%B4%E5%A5%8B-1401616/