. Here we are going to make our very first application in Angular.
- Make a folder called Angular(use proper name) suitable place in your computer.
- Then open visual studio code and open the folder which you has made before.
- Then go to view ------> Integrated Terminal( Here make sure you inside Angular Folder which you has created)
To create new Angular Project
ng new project-name
ex:here we use sample-app as project name
Then it automatically install needed libraries . If the command is successful you can go forward.
Then you have to create project folder
cd sample-app through I go to inside my folder.
Then you have to run your application.For that you should use following command.
ng serve

After it done successfully, you can go to a browser and type url "localhost:4200"
Then you can see some html from your angular application.
According to above way you can run your very first angular application just running couple of commands.
Then we see how controls flow inside when you run and angular application.
Angular Architecture
Module can introduce here as first building block. Angular app modular in nature. so it is a collection of many individual modules. Every module represents a feature area in your application.
Ex: user module- related with application's user
admin module - related with application's administrations
Every angular application has at least one module which is root module(app module)
Each module has relationship with component and services.
Components control position of the view on the browser.
Ex: component 1 - navigation
component 2 - side bar
component 3 - main content
your angular application has at least one component called root component(app component)
All other components will be nested to root one. Each component have HTML Template(represents the view in the browser) and class(controls the logic of particular view)
Summary
- An Angular app has one or more modules.
- Each module has one or more components.
- Each Component content HTML and class to control the logic of particular view.
- Modules also have services. I contains business logic of your application.
- Modules export and import code when required and render the view in browser.
Then we see what are the files in our project folder .
In here within ANGULAR we can see our sample app project folder. When you open it you can see lots of files there.
Here we can see file called "package.jason". This file contents libraries(modules) which are required
for your angular application work.
Then, there is an important folder called source folder. Within this you can see main.ts file.It is entry point to our angular application.
Then we also have app folder. In here we can see a file called app.module.ts . it is the root module of
our application.
Then also further in the app folder we can see a file called app.component.ts. It is the
root component of our application.








No comments:
Post a Comment