First App
Let's create our first app using Angular.
Step 1: Open the command prompt and select the source or directory where you want to place the new angular app
Step 2: Write the following command to create a new app in angular.
Syntax:
ng new app_name;
Example:
ng new myFirstApp;
Hence you have created your first Angular App, You can locate it inside the C:\Users\PRINCE location.
- Inside the myFirstApp folder, you see the src folder which is the main folder of our app.
- Inside src there is an app folder in which all the HTML CSS and TS files of the app are kept, this is the root folder.
Running Our First App
Step 1: For running our first App go to the project location where the app was created and type cmd in the address bar by clicking on it
OR
Simply open a command prompt and navigate to the project location using the cd command.
The command prompt will be open
Step 2: Now give the command ng serve to compile and run our app.
When our app compiled successfully, Go to the http://localhost:4200
Now, you can see that our app is running now.