Architecture of Angular 2+ Apps
Skills:
Systems Design Basics60%
Key Takeaways
The video covers the architecture of Angular 2+ apps, focusing on components, directives, services, and routers, and how they work together to build a scalable and maintainable application.
Full Transcript
in the nutshell we have four key players in an angular 2 app components directives routers and services let's take a look at each of these building blocks in more detail at the very core we have components a component encapsulate the template data and the behavior of a view so it's more accurate to call it a view component every angular 2 app has at least one component which we call the route component but in the real world an application often consists of tens or hundreds of components for example imagine we want to build an application like udemy we can divide this page into three components navigation bar sidebar and courses so each component has the template or HTML markup for the view as well as data and logic behind that view components can also contain other components so in the list of courses we can have multiple course components and in each course component we can have another component for rating that course the benefit of this architectural style is that it will help us break up a large application with various complex views into smaller more manageable components or as I said view components plus we can reuse these components in different parts of an application or even in a different application for example we can reuse this rating component here in a totally different application now you might be saying look Marsh I understand what you're saying about components but what are these components really like in the code a component is nothing but a plain typescript class so just like classes in other programming languages it can have properties and methods these properties hold the data for the view and the methods implement the behavior of the view like what should happen when we click a button now if you have never worked with angular before one thing that may be new to you is that these components are completely decoupled from the document object model or dumb in applications written with plain JavaScript or jQuery we get a reference to a Dom element in order to modify it or handle its events in angular we don't do that instead we use binding so in the view we bind to the properties and methods of our component if there is a change in the value of a property the Dom element bound to this property will refresh automatically so we can't and shouldn't get a reference to that Dom element in order to update it similarly to handle an event raised from a Dom element like click we bind that event to a method in our component when the user clicks that element the corresponding method in our component will be called now in case you're curious why these components are decoupled from the Dom the reason is that this makes our components unit testable if you have a plain class that is nothing but a bunch of properties and methods we can easily unit test it without having a document object model now sometimes our components need to talk to back-end api's to get or save data to have good separation of concerns in our applications we delegate any logic that is not related to view to a service so a service is just a plain class that encapsulates any non user interface logic like making HTTP calls logging business rules and so on we have another key player in angular apps and that's a router which is purely responsible for navigation so as the user navigates from one page to another it will figure out based on changes in URL what component to present to the user you will learn more about this in the section titled building single page apps and the last key player in angular is a directive similar to components we use directives to work with the Dom but a directive unlike a component doesn't have the template or HTML markup for view we often use them to add behavior to existing Dom elements for example we can use a directive to make a text box automatically grow when it receives focus angular has a bunch of built-in directives for common tasks like adding or removing Dom elements adding classes or styles to them repeating them but we can also create our own custom directives so this is the big picture as you go through this course you will see each of these building blocks in action well hello it's Maj here your angular 2 instructor thanks for watching my youtube channel this video you just watched is actually part of my comprehensive angular 2 course for beginners in this course I'll walk you through all the core concepts of angular 2 in a step-by-step and pragmatic way by the end of watching this course you will have all the necessary skills to build real-world applications with angular if you want to find out more about this course and the content I've covered click on the link in the video description with this link you can get the course with a discount hope to see you in the course
Original Description
🔥Get the COMPLETE COURSE (60% OFF - LIMITED TIME): https://programmingwithmosh.com/courses/angular
Learn the core building blocks of Angular 2 apps: components, directives, services, and routers.
And here are some other Angular 2+ tutorials on my channels:
Angular 2 for Beginners
https://youtu.be/_-CD_5YhJTA
Stay in touch:
https://www.facebook.com/programmingwithmosh/
https://twitter.com/moshhamedani
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Programming with Mosh · Programming with Mosh · 23 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
▶
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
6 Visual Studio Tips to Increase Your Productivity | Mosh
Programming with Mosh
Visual Studio Keyboard Shortcuts that Speed Up Debugging Applications | Mosh
Programming with Mosh
Backbone.js Tutorial Part 2 - Backbone.js Models: Working with Model Attributes
Programming with Mosh
Backbone.js Tutorial Part 3 - Backbone.js Models: Model Validation
Programming with Mosh
Backbone.js Tutorial Part 4 - Backbone.js Models: Model Inheritance
Programming with Mosh
Backbone.js Tutorial Part 1 - Backbone.js Models: Creating Models
Programming with Mosh
Backbone.js Tutorial Part 5 - Backbone.js Models: Syncing Models with the Server
Programming with Mosh
Backbone.js Tutorial Part 6 - Backbone.js Collections: Creating Collections
Programming with Mosh
Backbone.js Tutorial Part 7 - Backbone.js Collections: Working with Collections
Programming with Mosh
Backbone.js Tutorial Part 8 - Backbone.js Collections: Fetching Collections from the Server
Programming with Mosh
Backbone.js Tutorial Part 9 - Backbone.js Views: Creating Views
Programming with Mosh
Backbone.js Tutorial Part 10 - Backbone.js Views: Passing Data to Views
Programming with Mosh
Backbone.js Tutorial Part 11 - Backbone.js Views: Handling the DOM Events
Programming with Mosh
Backbone.js Tutorial Part 12 - Backbone.js Views: Handling the Model Events
Programming with Mosh
Backbone.js Tutorial Part 13 - Backbone.js Views: Handling Collection Events
Programming with Mosh
Backbone.js Tutorial Part 14 - Backbone.js Views: Templating
Programming with Mosh
Clean Code: Learn to write clean, maintainable and robust code
Programming with Mosh
C# Events and Delegates Made Simple | Mosh
Programming with Mosh
C# Generics Tutorial: Whats and Whys | Mosh
Programming with Mosh
Debugging C# Code in Visual Studio | Mosh
Programming with Mosh
Repository Pattern with C# and Entity Framework, Done Right | Mosh
Programming with Mosh
Angular 2 Tutorial for Beginners: Learn Angular 2 from Scratch | Mosh
Programming with Mosh
Architecture of Angular 2+ Apps
Programming with Mosh
Working with Components in Angular
Programming with Mosh
C# Tutorial For Beginners - Learn C# Basics in 1 Hour
Programming with Mosh
Difference between Junior and Senior Developers
Programming with Mosh
Step-by-step ASP.NET MVC Tutorial for Beginners | Mosh
Programming with Mosh
[Pluralsight]: Become a Full-stack .NET Developer
Programming with Mosh
Xamarin Forms Tutorial: Build Native Mobile Apps with C#
Programming with Mosh
Value Types and Reference Types in JavaScript
Programming with Mosh
Using Redux in Angular 2+ Apps | Mosh
Programming with Mosh
Testing Angular 2+ Apps with Jasmine and Karma | Mosh
Programming with Mosh
Profile and optimize your Angular 2 apps
Programming with Mosh
Build a Real-world App with ASP.NET Core and Angular 2
Programming with Mosh
Entity Framework 6 Tutorial: Learn Entity Framework 6 from Scratch
Programming with Mosh
Two-way Binding and ngModel in Angular 4
Programming with Mosh
Udemy Live 2017: Teaching Tech Panel
Programming with Mosh
Demo of An E-commerce App Built with Angular, Firebase and Bootstrap 4
Programming with Mosh
My Brand New Angular Course
Programming with Mosh
TypeScript Tutorial - TypeScript for React - Learn TypeScript
Programming with Mosh
Access Modifiers in TypeScript
Programming with Mosh
TypeScript Interfaces
Programming with Mosh
TypeScript Classes
Programming with Mosh
TypeScript Constructors
Programming with Mosh
TypeScript Properties
Programming with Mosh
Angular Tutorial for Beginners: Learn Angular & TypeScript
Programming with Mosh
AngularJS vs Angular 2 vs Angular 4 | Mosh
Programming with Mosh
Angular Material Tutorial | Mosh
Programming with Mosh
Angular Animations Tutorial | Mosh
Programming with Mosh
Firebase in Angular Applications | Mosh
Programming with Mosh
Deploying Angular Applications | Mosh
Programming with Mosh
Building Forms in Angular Apps | Mosh
Programming with Mosh
Directives in Angular Applications
Programming with Mosh
Routing and Navigation in Angular | Mosh
Programming with Mosh
Angular 4 in 40 Minutes
Programming with Mosh
[NEW COURSE] Unit Testing for C# Developers
Programming with Mosh
Unit Testing C# Code - Tutorial for Beginners
Programming with Mosh
C# Classes Tutorial | Mosh
Programming with Mosh
C# Object Initializers Tutorial
Programming with Mosh
C# Constructors Tutorial | Mosh
Programming with Mosh
More on: Systems Design Basics
View skill →
🎓
Tutor Explanation
DeepCamp AI