Install Node.js: Angular requires Node.js to be installed on your system. You can download and install Node.js from the official website: https://nodejs.org/.
Install Angular CLI: Once Node.js is installed, open your command prompt or terminal and run the following command to install Angular CLI:
npm install –g @angular/cli
This will install the latest version of Angular CLI globally on your system.
Step3:To create a new Angular project, navigate to the directory where you want to create the project using the command prompt or terminal and run the following command
ng new my-app
The Angular CLI installs the necessary Angular npm packages and other dependencies. This can take a few minutes. The CLI creates a new workspaces and a simple Welcome app, ready to run.
This will create a new Angular project named "my-app" in the current directory.
The Angular CLI includes a server, so that you can build and serve your app locally.
cd my-app
ng serve --open
The ng serve command launches the server, watches your files, and rebuilds
the
app as you make changes to those files.
The --open
or -o
just Option automatically opens
your
browser to http://localhost:4200/.
Download the Admitro rar/zip file.
Extract it there you will find Hostma(main project file), Starter-kit(set of files and code that provides a basic structure and functionality for a specific type of application), Readme.txt, Documentation.
Go to the Hostma folder/directory. open the command prompt/ terminal run the below command.
npm install
// If you faced any issue running "npm install" Please make sure to use,
npm install --force // This command will ignore if there was any dependency issue.
(or)
yarn install // yarn can handle dependency issues better than npm.
Once the installation was successful then you can find node_modules folder where all the downloaded libraries are available.
To serve the Angular project, In command prompt or terminal run the following command:
ng serve
Once you serve your application by default port is set to 4200 :http://localhost:4200/
To change the Angular port manually, you can specify the port number when running the ng serve command. By default, the port is set to 4200, but you can specify a different port number by appending `--port` followed by the desired port number.
ng serve --port 1234
To check the current version of Angular that you are using in your project, open the package.json file and look for the "@angular/core" dependency. The version number will be listed next to it
Step2:Update the Angular CLI: If you are using an older version of the Angular CLI, you need to update it to the latest version using the following command:
npm install -g @angular/cli@latest
or
yarn global add @angular/cli@latest
This will install the latest version of the Angular CLI globally on your system.
Step3:Update the Angular core packages: To update the Angular core packages to the latest version, run the following command.
ng update @angular/core
This will update all the core packages of Angular to the latest version.
Step4:Update the Angular CLI configuration: If there are any changes in the Angular CLI configuration, you can update it by running the following command.
ng update @angular/cli
This will update the Angular CLI configuration to the latest version.
Step5:If there are any other dependencies that need to be updated, you can update them manual or you can update the version in package.json file.
Open the command prompt or terminal and navigate to the root directory of your Angular application.
Step2:Run the following command to build the application.
ng build
This will compile your Angular application and create a production-ready build in the `dist/` folder.
Step3:If you're serving the app out of a subfolder, edit a version of inddex.html to set the base href appropriately. For Example, if the URL to index.html is www.abc.com/my/app/index.html, set the base href to
<base href="/my/app/">
You can also set the base href right in the ng build command.
ng build --base-href="/my/app/"
This is the simplest production-ready deployment of your application. For more detailes information, visit this official Angular Documentation Website.
Deploying an Angular application can be done in several ways depending on the specific hosting environment and requirements of your application.