To create an App you have to write something , so its called a syntax “the way you wanna write “
ng new app_name
so in this our App name will be : ng new angular8firstapp
You can see that a folder is created. This is your first created app of Angular 8.
Open this folder and where you will see the some Subfolders
Files used in Angular 8 App folder :
Angular 8 App files which are mainly used in your project are given below:
- src folder: This is the folder which contains the main code files related to your angular application.
- app folder: The app folder contains the files, you have created for app components.
- app.component.css: This file contains the cascading style sheets code for your app component.
- app.component.html: This file contains the html file related to app component. This is the template file which is used by angular to do the data binding.
- app.component.spec.ts: This file is a unit testing file related to app component. This file is used along with other unit tests. It is run from Angular CLI by the command ng test.
- app.component.ts: This is the most important typescript file which includes the view logic behind the component.
- app.module.ts: This is also a typescript file which includes all the dependencies for the website. This file is used to define the needed modules to be imported, the components to be declared and the main component to be bootstrapped.
Install Visual Studio Code IDE or JetBrains WebStorm
You must have an IDE like Visual Studio Code IDE or JetBrains WebStorm to run your Angular 8 app.
VS Code is light and easy to setup, it has a great range of built-in code editing, formatting, and refactoring features. It is free to use. It also provides a huge number of extensions that will significantly increase your productivity.
You can download VS Code from here: https://code.visualstudio.com
JetBrains WebStorm is also a great IDE to develop Angular 8 apps. It is fast, attractive, and very easy to use software but, it is not free to use. You have to purchase it later, it only provides a trial period of 30 days for free.
You can download Jetbrains Webstorm from here: https://www.jetbrains.com/webstorm/download/#section=windows
Here, i was using VS Code IDE:
You can see that your project is open in the VS Code IDE. You can also make changes in .ts and html files to change your output accordingly.
Run your app :
Open your node.js command prompt and go to your project by using cd command and then run the ng serve command to compile and run your app
Command : ng serve
Hurray ! Compiled Successfully :
Open your browser and go to local host mentioned in Cmd :
So you had learnt now how to make an Simple Angular 8 App , congratulations , stay tuned for more and this is how your app will look like :