#03 Editing the First Angular Project | Getting Started with Angular | A Complete Angular Course

procademy
24 May 202318:39

Summary

TLDRIn this lecture, the instructor demonstrates how to create, run, and edit a basic Angular project. The process starts by running the Angular application on localhost (port 4200) using the 'ng serve' command. They then explain how to navigate through the project folder, open it in VS Code, and identify the source of the application's HTML rendering. The lecture covers the role of Angular components, data binding, and introduces dynamic content generation using Angular’s features. This foundational setup prepares for deeper exploration in upcoming lectures.

Takeaways

  • 👨‍💻 The Angular project is set up and running on localhost port 4200 after using the 'ng serve' command.
  • 🛑 Pressing Ctrl + C will terminate the Angular process, making the app unavailable at localhost 4200 until 'ng serve' is run again.
  • 🗂 VS Code is recommended as the code editor for the course, though other editors like Atom or Sublime can also be used.
  • 📂 To edit the project in VS Code, navigate to the project folder and open it through the editor.
  • 💻 The default UI is loaded from the 'index.html' file when running the Angular app.
  • 📜 When 'ng serve' is executed, it injects five scripts (runtime.js, polyfills.js, styles.js, vendor.js, and main.js) into 'index.html'.
  • 📝 The 'approot' is a custom Angular component tag that loads the 'app.component.html' template when used in the HTML.
  • 🎨 The 'app.component.ts' file is the core file where the class and logic of the app component are defined, which ties the HTML and TypeScript together.
  • 🔗 Dynamic content in Angular can be generated using data binding with double curly braces, allowing for dynamic updates in the UI.
  • 🔄 Angular enables single-page applications, meaning only one 'index.html' file is loaded, and the content changes dynamically without reloading the entire page.

Q & A

  • What is the purpose of the NG serve command in an Angular project?

    -The NG serve command compiles the Angular project, creates necessary bundles, and starts a development server. This allows the project to be accessible at a URL, typically localhost:4200, while the process is running.

  • What happens when the process started by NG serve is killed?

    -When the NG serve process is killed, the Angular application can no longer be accessed at localhost:4200 because the development server stops running. The project must be restarted with NG serve to make it accessible again.

  • How do you open an Angular project in Visual Studio Code?

    -To open an Angular project in Visual Studio Code, go to 'File' > 'Open Folder,' navigate to the project folder, and select it. The project files will then be available for editing within VS Code.

  • Which file in an Angular project defines the main HTML structure that gets rendered initially?

    -The `index.html` file in the `src` folder defines the main HTML structure that gets rendered when an Angular project is loaded in the browser.

  • What is the role of the app-root element in an Angular application?

    -The `app-root` element serves as a selector for the root component in the Angular application, typically rendering the content defined in the `app.component.html` file.

  • What is the purpose of the app.component.ts file in an Angular project?

    -The `app.component.ts` file contains the logic for the root component of the Angular application. It includes a class (e.g., AppComponent) that is decorated with the `@Component` decorator, defining the selector and the template for the component.

  • How does Angular generate dynamic content in the HTML?

    -Angular generates dynamic content using data binding. For example, by using double curly braces (`{{}}`), you can bind a component's property (like `title`) to the HTML, dynamically rendering the property's value in the UI.

  • What is the difference between static and dynamic content in Angular?

    -Static content is hardcoded in the HTML and does not change, whereas dynamic content is generated based on component properties and can change depending on user interaction or data updates.

  • Why does Angular use TypeScript instead of JavaScript, and how is it executed in the browser?

    -Angular uses TypeScript because it provides better type checking and object-oriented programming features. However, TypeScript is compiled into JavaScript, which is then executed by the browser.

  • What is the importance of the scripts injected into the index.html file in an Angular application?

    -The scripts injected into the `index.html` file (like `runtime.js`, `polyfills.js`, `vendor.js`, etc.) are essential for running the Angular application. They include necessary bundles and dependencies compiled by the NG serve command.

Outlines

00:00

👋 Introduction to Angular Project Setup

In this paragraph, the speaker welcomes the audience back and summarizes the previous lecture where they created their first Angular project. They discuss the default appearance of the Angular application, explain how the project is accessible through localhost at port 4200 due to the NG serve command, and demonstrate how terminating the NG serve process stops the server, making the application inaccessible.

05:02

🔧 Setting Up VS Code for Angular Development

This section explains the importance of a code editor for modifying the Angular project. The speaker introduces VS Code as their preferred editor and provides instructions for downloading and installing it. They describe how the correct operating system is automatically selected for download and guide users through the installation process, explaining how to launch VS Code after it is installed.

10:03

📂 Opening the Angular Project in VS Code

The speaker demonstrates how to open the Angular project folder in VS Code by navigating to the folder through the File menu. They explain how to view the source code of the running Angular application, emphasizing that the index.html file is the main file rendering the UI in the browser. They also point out additional scripts injected into the HTML by Angular CLI when the project is served.

15:04

📜 Understanding app-root and Components in Angular

This section delves into the `app-root` selector, explaining that it represents a component that renders the Angular UI. The speaker removes and re-adds `app-root` to demonstrate its impact on the UI. They introduce the concept of components, specifically focusing on the app component and its associated files (TypeScript, HTML, CSS), and briefly mention the role of the `component` decorator.

🏗 Dynamic Content and Data Binding in Angular

In this paragraph, the speaker explains how Angular handles dynamic content. They show how to use data binding to dynamically display the project name (`angular ecard`) by binding it to a `title` property in the app component. They demonstrate how changing the `title` property in the TypeScript class updates the content displayed in the browser.

💻 Mixing Static HTML with Dynamic Content in Angular

The speaker clarifies the purpose of using Angular to mix static HTML with dynamic content. They explain how Angular generates dynamic content using data binding and how static HTML alone does not necessitate a framework like Angular. The example provided illustrates how changing the `title` property dynamically alters the rendered content.

🔄 Single Page Application and Routing in Angular

Here, the speaker discusses Angular’s single-page application (SPA) nature, explaining that the browser only loads one HTML file, `index.html`, and JavaScript dynamically changes the content based on navigation within the application. They hint at future discussions on routing and emphasize that TypeScript is compiled into JavaScript, which ultimately handles content changes dynamically in the browser.

🚀 Wrapping Up and Next Steps

The final paragraph summarizes the lecture, noting that more content will be added to the Angular application in future lessons. The speaker reiterates the significance of using Angular for generating dynamic content and ends the lesson, encouraging listeners to ask questions if needed.

Mindmap

Keywords

💡Angular project

An Angular project is a web application built using Angular, a popular framework for developing single-page applications. In the video, the speaker creates an Angular project, showing its default structure and explaining how it can be customized by modifying its files and components.

💡NG serve

The NG serve command is used to run an Angular project locally, creating a development server that can be accessed on a specific URL, such as localhost:4200. The video demonstrates how this command starts the server and keeps it running, making the project accessible in a browser.

💡localhost:4200

This URL represents the local server where the Angular project is hosted when using the NG serve command. The speaker frequently refers to this address as the location where the default Angular project is displayed in the browser during development.

💡Component

In Angular, a component is a building block of the user interface, consisting of HTML, CSS, and TypeScript code. The video discusses how components like app-root and app.component.ts are used to render content dynamically and manage the look and feel of the application.

💡app-root

app-root is a selector used in Angular to render the app component in the browser. The speaker explains that removing app-root will result in a blank page, showing that this is where the core UI elements of the Angular project are rendered.

💡index.html

index.html is the main HTML file loaded by the browser when the Angular application is run. The video shows how this file remains the same during the entire lifecycle of the Angular application, while its content is dynamically updated through Angular's rendering processes.

💡Dynamic content

Dynamic content refers to elements in a web page that are generated and modified at runtime, based on data or user interactions. The video explains how Angular allows developers to use dynamic content through features like data binding, making the application responsive and interactive.

💡VS Code

VS Code, or Visual Studio Code, is a code editor used for writing and managing code in web development. The speaker uses VS Code in the video as the preferred editor for working with Angular projects, explaining how to download, install, and open project folders in VS Code.

💡Data binding

Data binding is a concept in Angular that allows developers to bind data from the component class to the HTML template. In the video, this is demonstrated with the title property, which is dynamically updated in the web page through curly braces in the HTML file.

💡TypeScript

TypeScript is a superset of JavaScript used in Angular for writing more robust and structured code. The speaker explains how the app.component.ts file defines the logic of the component, and how TypeScript gets compiled into JavaScript to dynamically update the content of the web page.

Highlights

Created the first Angular project with all the required files, folders, and dependent packages.

Running the Angular project on localhost at port 4200 using the 'ng serve' command.

Demonstrated how killing the process with Ctrl+C stops access to the application.

Explained how the 'ng serve' command compiles the project and creates bundles for access on localhost.

Guided through installing and setting up VS Code as a code editor for Angular projects.

Opened the Angular project folder in VS Code for editing and customizing the project.

Showed that the index.html file is rendered when running the Angular project in the browser.

Scripts injected into index.html are generated and bundled by Angular CLI during 'ng serve'.

The 'approot' element renders the main app component in the UI, linking to a specific component in Angular.

Explained the structure of Angular components, including the .ts, .html, and .css files.

Demonstrated how the app component's HTML file content is rendered in the UI.

Illustrated how Angular handles dynamic content generation using data binding with properties like 'title'.

Clarified Angular's role in creating dynamic content, distinguishing between static HTML and dynamic rendering.

Reiterated the use of Angular in creating single-page applications where only the content changes dynamically, not the HTML file itself.

Explained that TypeScript code is compiled into JavaScript, which dynamically updates the content in the browser.

Transcripts

play00:00

hello and welcome back

play00:01

so in the last lecture we created our

play00:04

very first angular project so we have

play00:06

our angular project ready with all the

play00:08

required files and folders and also the

play00:10

dependent packages

play00:12

and when we run that angular project it

play00:15

looks something like this here let me go

play00:17

ahead and let me zoom out a little bit

play00:19

maybe 200 percent

play00:22

so this is how our angular application

play00:25

looks currently so this is the default

play00:27

look of the angular project when we

play00:29

first create it and now we can go ahead

play00:31

and we can edit the look and feel of

play00:33

this project but before I do that let me

play00:35

show you one thing So currently this

play00:38

project is running at localhost Port

play00:40

number 4200 and we are able to access

play00:43

this web page on localhost port number

play00:45

4200 because in the last lecture we run

play00:49

this NG serve command Okay so first we

play00:52

move to the project folder and in that

play00:55

project folder we run this NG sub

play00:57

command now what this NG serve command

play01:00

does is it runs a process behind the

play01:02

scenes and as long as that process is

play01:05

running we will be able to access this

play01:08

webpage on localhost port number 4200

play01:11

and if we kill that process that means

play01:14

the process which is currently running

play01:15

when we run this NG serve command in

play01:18

that case we will not be able to access

play01:20

this angular application on this URL on

play01:23

localhost port number 4200 let me

play01:25

actually show you that so here I am

play01:27

going to kill the process and in order

play01:29

to kill the process we can simply press

play01:31

Ctrl C on the keyboard

play01:35

so now the process has been terminated

play01:37

so now if I go back to browser and if I

play01:40

refresh the page now we should not be

play01:42

able to access this web application at

play01:44

this port number

play01:46

because now we have killed the process

play01:48

so the process is no more running and

play01:51

because of that we are not able to

play01:52

access the angular application on this

play01:54

URL but if I go ahead and if I start

play01:58

that process Again by running the NG sub

play02:00

command so keep in mind that in order to

play02:03

run your angular project first you need

play02:05

to move to the project folder okay this

play02:08

is my project folder path

play02:11

so this is that path inside this angular

play02:15

ecard folder we have our all the project

play02:17

related files and folders so this

play02:20

angular card here it is my project

play02:22

folder so using command prompt first I

play02:25

need to move to that folder that project

play02:27

folder and in there I need to type NG

play02:31

serve command in order to start the

play02:33

angular CLI process so if I press enter

play02:35

it will again compile the project it

play02:38

will create some bundles and it will

play02:41

start the process and then we will be

play02:43

able to access the angular application

play02:44

again so you can see the project has

play02:46

been compiled the bundles have been

play02:48

created and now that angular process is

play02:50

started and since the angular process

play02:54

has started now it is running we can go

play02:56

back to the browser and now you can see

play02:58

we are able to access the angular

play02:59

application at this URL localhost port

play03:02

number 4200

play03:04

so in case if you are not seeing this

play03:06

web page when you are typing this URL

play03:09

localhost port number 4200 that means

play03:12

your development server is not running

play03:14

and in order to start your development

play03:16

server you need to go to your project

play03:18

folder and in there you need to type

play03:20

this NG serve command and start the

play03:22

annular CLI process and then you'll be

play03:24

able to access your angular application

play03:26

at this URL

play03:28

all right

play03:31

now in order to proceed further in this

play03:33

course we need a code editor which we

play03:35

will use to make changes in our angular

play03:37

project

play03:39

so in this course I am going to use vs

play03:41

code as my code editor if you have any

play03:44

other preferences if you want to use any

play03:46

other code editor like atom or Sublime

play03:48

you can go ahead and you can use that

play03:49

but if you want to follow along with me

play03:51

in this course then you can also go

play03:53

ahead and download vs code code editor

play03:55

because that's what I'll be using in

play03:57

this course

play03:58

so let me go ahead and let me open a new

play04:00

window here

play04:01

and here let's search for vs code

play04:07

okay and you need to go to this first

play04:11

result code.visualstudio.com

play04:15

and from here you can download vs code

play04:17

on your local machine

play04:19

now in order to download vs code on your

play04:21

local machine you need to click on this

play04:23

download button so here you can see the

play04:25

operating system has been selected

play04:27

automatically in my case I am using

play04:28

Windows so that operating system has

play04:30

been selected automatically

play04:31

in your case your operating system will

play04:33

be selected here if you are using

play04:35

Windows then it will say download for

play04:36

Windows if you are using Mac OS it will

play04:38

say download for Mac OS or if you're

play04:40

using Linux it will say download for

play04:42

Linux but in case if your operating

play04:44

system has not been selected then you

play04:47

can also click on this drop down and

play04:48

from here you can select your operating

play04:50

system and then you can go ahead and you

play04:52

can click on this download button in

play04:54

order to download vs code in your local

play04:56

development machine

play04:58

so when you will click on this download

play04:59

button it is going to download an MSI

play05:01

file let me actually show you that so if

play05:03

I click on this download button

play05:05

it is going to download an MSI file this

play05:08

exe file okay now all you have to do is

play05:11

once this exe file is completely

play05:13

downloaded you can double click here

play05:16

or you can go to the downloads folder

play05:18

and from there you can double click on

play05:21

this exe it is going to open an

play05:23

installation window just follow along

play05:25

the installation steps it is very easy

play05:27

there is nothing complex in that just

play05:30

follow the installation steps and

play05:32

install this vs code on your local

play05:33

development machine

play05:35

now once the vs code is installed on

play05:38

your machine

play05:39

you can just go ahead and open vs code

play05:41

if you're on Windows in the search bar

play05:44

you can type vs code

play05:47

and you can click on that

play05:50

so it will open vs code

play05:54

when you will open it you will see this

play05:56

welcome screen

play05:57

now what we want here is in vs code we

play06:00

want to open our angular project folder

play06:03

okay for that you can go to file

play06:06

open folder

play06:08

and then go to the location where your

play06:10

project folder is located in my case it

play06:13

is in documents folder in there we have

play06:15

this angular complete course folder and

play06:18

in there we have our project folder

play06:20

called angular ecard so I will select

play06:22

this project folder and I will click on

play06:25

the select folder button and it will

play06:27

open that project folder in vs code

play06:30

let's close this welcome screen here

play06:32

all right so here we have opened our

play06:34

angular project in vs code now the next

play06:37

question which will come to your mind is

play06:39

when I'm running this angular project in

play06:41

the browser

play06:43

it is showing this UI so from where this

play06:47

UI is being rendered

play06:49

now to show you that which HTML file is

play06:52

being rendered in the browser in order

play06:54

to show this UI what I will do is I will

play06:56

right click and I will say view page

play06:58

source

play07:00

so here you can see the page source

play07:02

which is being rendered in order to show

play07:05

this UI

play07:07

okay so just look at the content here

play07:09

let me increase the font size here

play07:14

okay

play07:15

so this HTML here it is coming from

play07:19

index.html file and to go to index.html

play07:22

file you can open this Source folder in

play07:24

there you will see this index.html file

play07:27

okay and you will see the same content

play07:30

here okay so this content is what we are

play07:33

seeing here when we are viewing the

play07:35

source code of this web page

play07:38

right now here you will also see some

play07:40

extra things like you'll also see these

play07:42

scripts which have been added here but

play07:45

these scripts are not there in the

play07:47

index.html file apart from that

play07:50

everything is same so this HTML content

play07:52

is also available

play07:54

here when we are viewing the page source

play07:57

all right so we know that when we are

play08:00

running our angular project in the

play08:02

browser index.html file is getting

play08:04

loaded and it is being rendered

play08:07

now the next question which will come to

play08:09

your mind is from where these scripts

play08:11

are coming

play08:12

well these scripts are coming from

play08:15

angular CLI

play08:16

so basically when we run this NG serve

play08:19

command what it does is it first

play08:22

compiles our project then it creates

play08:25

some bundles so these bundles basically

play08:28

these five bundles and then it inject

play08:31

these bundles in the index.html file so

play08:35

these are the scripts which you will see

play08:37

here

play08:38

you see runtime.js

play08:41

polyfills.js styles.js

play08:45

vendor.js and main.js so these are the

play08:48

five script files which have been

play08:50

injected in the index.html file

play08:52

and these script files have been created

play08:55

by this NG serve command

play08:57

they have been bundled and they have

play08:59

been injected in our index.html file of

play09:02

angular project I hope it is clear

play09:05

now the next question which will come to

play09:07

your mind is in the UI we have so many

play09:10

things rendered

play09:12

but in the HTML file I only see this

play09:15

approot

play09:17

and this approot is not even an HTML

play09:19

element

play09:20

then what is this approot and when we

play09:23

are using this approot how it is

play09:25

rendering this UI

play09:27

now just to show you that this approot

play09:31

is what is rendering this UI let me go

play09:34

back to vs code and let me remove this

play09:36

approach from here so I will simply cut

play09:39

it from here let's save the changes

play09:42

let's go back to the browser let me

play09:45

reload the page

play09:48

and now you will see the page is blank

play09:50

but if I go back and if I bring back

play09:53

that approved

play09:54

if I see the changes now

play09:57

then you will see that that UI is back

play10:00

so it is this app Root which is

play10:03

rendering this UI when we are running

play10:06

our angular project

play10:08

now let's try to understand what this

play10:10

approach actually is

play10:12

this Air route here it is basically

play10:15

rendering a component

play10:17

here it is rendering an app component

play10:20

now we will talk about components in

play10:22

great detail in our coming lectures but

play10:24

for now just understand that when we are

play10:26

using this approot like an HTML element

play10:28

here it is going to render a component

play10:31

now which component it is rendering here

play10:33

it is rendering app component

play10:36

and to see the app component you see

play10:38

this app folder if I expand this here

play10:40

you will see that we have five files app

play10:42

component.css appcomponent.html

play10:46

appcomponent.spec.ts and appcomponent.ts

play10:48

file we also have this app modules.ts

play10:50

file but it is not part of app component

play10:53

okay we will talk about this app

play10:55

module.ts file letter in this course but

play10:57

for now just understand that a component

play10:59

consists of four main files the

play11:03

typescript file so this dot TS is an

play11:05

extension of typescript file so we have

play11:07

a typescript file we have an HTML file

play11:10

we have a CSS file and we also have the

play11:12

spec.ts file now the spec.ts file is not

play11:15

important at this point of time

play11:16

basically in this spec.ts file we write

play11:19

the unit tests for testing our component

play11:22

okay but a component has mainly three

play11:25

files app component.ts

play11:28

appcomponent.html and appcomponent.css

play11:31

in these four files the most important

play11:34

file is this app component.ts file this

play11:37

is a typescript file and in there you

play11:39

will have a component class

play11:41

in this case the component class name is

play11:44

app component

play11:45

and if you notice this app component

play11:48

class have been decorated with this

play11:49

component decorator

play11:52

again we will talk about decorators in

play11:54

great detail in our coming lectures but

play11:56

for now just understand that when we

play11:58

create a component first we create a

play12:01

class in this case the class name is app

play12:03

component and we need to decorate that

play12:05

class with this at component decorator

play12:07

in order to make that class a component

play12:10

class

play12:11

and to this at component decorator here

play12:14

we are passing an object

play12:16

and in this object you will see we have

play12:18

a selector which is approot

play12:21

so it is the same approot which we are

play12:24

using here

play12:26

so for a component class when we specify

play12:29

a selector the value of that selector

play12:32

can be used as an HTML element

play12:35

and that's what we are doing here we are

play12:37

using the value of this selector this

play12:40

approot like an HTML element

play12:43

now when we use a selector like this

play12:46

in that case what it is going to do is

play12:49

in place of this selector it is going to

play12:53

render the template which is associated

play12:55

with that selector

play12:57

in this case with this selector this

play13:00

template is associated

play13:02

now this template here we are simply

play13:05

calling it template URL because to this

play13:06

we are assigning a path the path of the

play13:09

HTML file

play13:10

so in this case wherever we will use

play13:13

this approot there the content of this

play13:16

HTML file will be rendered

play13:18

now where is this HTML file present so

play13:21

in the same app folder you will see that

play13:23

we have this app component.html

play13:26

and in this app component.html we have

play13:28

some HTML and CSS so it is this HTML and

play13:32

CSS which is getting rendered in the UI

play13:35

when we are using this approot like an

play13:38

HTML element okay so here we have a

play13:41

selector

play13:42

we are using that selector like an HTML

play13:44

element for this selector

play13:47

we have an Associated template in this

play13:50

case that template is

play13:52

appcomponent.html file so wherever we

play13:54

will use this selector like an HTML

play13:57

element there the content of this HTML

play14:01

file will be rendered

play14:02

so in the UI currently this HTML is

play14:06

being rendered and that's why the UI

play14:09

looks like this but if I go ahead and if

play14:11

I delete everything from this HTML

play14:14

and if I add some new htmls here

play14:17

here let's add an H2 element and here

play14:20

let's say welcome to

play14:22

angular

play14:24

okay a simple H2 element

play14:27

let me save the changes now and now if I

play14:29

go to the web page you will see that H2

play14:32

element rendered in the web page

play14:35

now here one thing you need to

play14:37

understand is here we are writing static

play14:40

HTML and for writing static HTML we

play14:43

don't need a framework like angular

play14:45

we use a framework like angular in order

play14:48

to generate Dynamic contents

play14:51

right so we don't use angular for

play14:53

generating static content we use it for

play14:55

generating Dynamic content

play14:57

so how can we generate Dynamic content

play14:59

using angular in this case so let's say

play15:01

instead of Welcome to angular I want to

play15:04

say welcome to ecard okay that's our

play15:07

project name

play15:08

so here either we can say ecart or we

play15:12

can generate that content dynamically

play15:14

for that let's go to our app component

play15:16

class in there we have a property called

play15:19

title which is currently assigned with

play15:21

angular ecard

play15:23

so if I go to app component.html and

play15:26

here if I say welcome to and then if I

play15:29

use a double set of curly braces like

play15:31

this and in there I simply specify title

play15:36

here

play15:38

the value of this title property will be

play15:41

rendered now what is the value of this

play15:42

title property is this angular ecard so

play15:45

in place of this angular ecard will be

play15:48

rendered if I save the changes if I go

play15:51

back to the browser

play15:52

you will see now it says welcome to

play15:55

angular ecard

play15:56

so in this way we are generating Dynamic

play15:59

content whenever we will change the

play16:01

value of this title property for example

play16:04

instead of angular ECOT if I say

play16:08

if I save the changes if I go back to

play16:11

the browser

play16:13

you see now it says welcome to ecard

play16:16

so now we are generating the content

play16:18

dynamically

play16:19

and this concept here is called as data

play16:21

binding so basically we are binding this

play16:24

title property in our HTML using this

play16:27

double set of curly braces

play16:30

and don't worry we are going to talk

play16:31

about data binding and component in

play16:33

great detail in our coming lectures

play16:35

so basically angular allows us to mix

play16:37

static HTML code with Dynamic things we

play16:40

want to Output in the code

play16:43

so this is a very simple change we have

play16:45

made in our angular project right now

play16:46

but we are going to do a lot of stuff in

play16:48

our coming lectures

play16:50

now one thing which I want you to

play16:51

remember is that in the very first

play16:53

lecture we learned that we use angular

play16:56

for creating single page applications

play16:57

that means when we run an angular

play16:59

application only a single HTML file will

play17:02

be loaded in the browser and that will

play17:04

be rendered by the browser

play17:06

whenever we navigate around in the

play17:07

angular application only the content of

play17:10

that HTML file will change the HTML file

play17:12

itself will not change it will always

play17:14

remain same

play17:15

and that single HTML file which gets

play17:18

loaded in the browser when we run our

play17:20

angular application is this index.html

play17:23

file

play17:24

okay

play17:25

and in the future lectures when we will

play17:27

implement the routing in our angular

play17:29

application that time you will see that

play17:31

when we are navigating to different URLs

play17:34

the HTML page will remain the index.html

play17:36

file but the content will change

play17:38

dynamically and that content will be

play17:40

changed by JavaScript

play17:43

now here you might see that you're

play17:45

saying that the content will be changed

play17:46

by JavaScript but we are not even using

play17:48

JavaScript in our angular application

play17:50

then how JavaScript is going to change

play17:52

the content well keep in mind that the

play17:55

typescript code gets compiled to

play17:57

JavaScript code so we write our code in

play17:59

typescript but ultimately when the code

play18:02

is compiled that typescript code will be

play18:04

converted to JavaScript and that

play18:06

JavaScript will change the content

play18:08

dynamically

play18:09

all right so for now this should be it

play18:12

from this lecture we are going to add

play18:14

more content in our angular application

play18:15

currently we have added only one H2

play18:17

element but we are going to add more

play18:20

HTML contents in our web page and we are

play18:22

going to make it look nicer and dynamic

play18:24

but for this lecture this should be

play18:27

enough

play18:28

if you have any questions then feel free

play18:30

to ask it thank you for listening and

play18:32

have a great day

Rate This

5.0 / 5 (0 votes)

関連タグ
Angular setupWeb developmentDynamic contentData bindingVS CodeSingle page appHTML templatesJavaScriptTypeScriptFrontend framework
英語で要約が必要ですか?