In this article, we are going to set up Angular 5 app using Visual Studio Code. We will be using Angular CLI for our demo.
The first step is to install Node.js. Open node.js download page from here. You will see the following display.
Download and install the latest LTS version as per the configuration of your machine. The current version of Node LTS is 8.9.2. Installing node.js will also install npm (node package manager) on your system.
To check the version of node and npm installed on your machine, run the following command in command prompt.
Since node and npm are installed, the next step is to install Angular CLI. Run the following command in a command window.
This will start Angular CLI installation on your machine. This is going to take some time; so sit back, make some coffee, and relax.
Once Angular CLI is installed successfully, open VS Code and navigate to View >> Integrated Terminal.
This will open the terminal window, as shown in the image below.
The name of our Angular application is myFirstApp which is inside AngularDemo directory.
So, we will first navigate to our application using the below commands.
Now, we use the following command to start the web server.
After running this command, you can see that it is asking to open http://localhost:4200 in your browser. So, open any browser on your machine and navigate to this URL. Now, you can see the following page.
This will open the code file of our application in a new VS Code window. You can see the following file structure in Solution Explorer.
Now, we need to change the message on the web page from “Welcome to app!” to “Welcome to the world of Angular 5!”
To achieve this, open /src/app/app.component.ts file.
Change the value of title property in AppComponent class to ” the world of Angular 5″.
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'the world of Angular 5'; }
Just save the file and navigate to http://localhost:4200 (remember that the web server is still running). You can see the updated web page as shown below.
Introduction Blazor is a .NET web framework that allows us to create client-side applications using…
Introduction In this article, we are going to create a sudoku solver with the help…
Introduction In this article, we will learn how to implement Azure serverless with Blazor web…
Introduction Angular is an open-source framework that allows us to create applications for multiple platforms…
Introduction In this article, we will create an optical character recognition (OCR) application using Angular…
Introduction In this article, we will create an optical character recognition (OCR) application using Blazor…