search
HomeWeb Front-endJS TutorialHow to set up a development environment for angularjs? Analysis of the process of building a development environment with angularjs

This article mainly introduces about building the development environment for angularjs. Here is the process of building the angularjs development environment. If you haven’t read what you want to see, let’s start reading this article together

1. First, let’s briefly introduce the features of Angular-cli:

Angular-cli can quickly build a framework and create modules, services, classes, directives, etc.;

It has the function of webpack, which can realize code separation, on-demand loading, etc.;

Automatically configure the development environment, Test environment and production environment can realize code packaging, compression and hot deployment, as well as module testing and end-to-end testing.

Angular-cli can automatically identify the pre-compilation of sass and less through the suffix;

Angular-cli can configure TypeScript when creating, and can also make some personalized configurations;

The project structure created through Angular-cli is a best practice and can be used in production environments;

2. Now start installing nodejs:

AngularJS needs to use Nodejs, so we need to install nodejs first and need to use nodejs. The download address of nodejs is: https: //nodejs.org/en/download/ (If you want to see more, go to the PHP Chinese websiteAngularJS Reference Manual column)

3. You need to install npm and cnpm## here

#The next step is to install npm.

NPM is a package management tool installed along with NodeJS. It can solve many problems in NodeJS code deployment. Common usage scenarios include the following:

Allow users to download third-party packages written by others from the NPM server for local use.

Allows users to download and install command line programs written by others from the NPM server for local use.

Allows users to upload packages or command line programs written by themselves to the NPM server for others to use.

The installation of nodejs and npm has been completed here, but there will be some problems if you use npm to install it in Datianchao, so we use cnpm to install it, which is also a package of npm.

Install cnpm, execute the command: npm i -g cnpm

After executing this command, wait for completion, then enter cnpm version to check whether the installation is completed. I have already installed it here, so you can go in .

After installing cnpm, we start to install Angular-cli.

Execute the command: cnpm i -g angular-cli

Then you can execute the ng version command to check whether the installation is complete and the version of angular-cli

After the installation is completed, we You can use the ng command to start creating the project.

4. Now you need to create the project:

After installing angular-cli, you can create the project directly. Execute the command: ng new JustForTest

Among them, JustForTest is the project name

Executing this command will create a lot of files, and you need to wait for a while. This step will take a long time, and you need to wait until the installation of nod_.modules is completed.

Use ng serve to start directly.

In this way, you can start the project directly. We enter in the browser: http://localhost:4200 and you can directly access:

5. The project is now being imported

If we are looking for a project from the Internet, how do we start it locally? Let’s do it in detail:

I recommend everyone to take a look at this tutorial by Teacher Da Mo: The Angular2.0 video tutorial is here

. For the demonstration here we also use a project of Teacher Da Mo: NiceFish , first we need to clone the project through git, which will not be demonstrated here. This is the project address of NiceFish: http://git.oschina.net/mumu-osc/NiceFish

After the project is cloned , the command line enters the directory where the project is located.

Execute command: cnpm i -g @angular/cli

Let me explain here, before we installed the global angular-cli.

Wait for the command execution to complete, then execute the command: cnpm install

Then execute the command: ng serve -prod -aot

Then wait for the compilation to complete.

After completion, we can enter in the browser:

http://localhost:4200 to access the project.

Then, there is no more. This article about the angularjs construction and development process ends here (if you want to see more angularjs related knowledge, go to the PHP Chinese website

AngularJS Learning ManualColumn learning). If you have any questions, you can ask below.

【Editor’s Recommendation】

How to develop web applications with angularjs? Angularjs development web application example

Do you know the routing principle of angularjs? Here are the detailed principles of angularjs routing

The above is the detailed content of How to set up a development environment for angularjs? Analysis of the process of building a development environment with angularjs. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
JavaScript Frameworks: Powering Modern Web DevelopmentJavaScript Frameworks: Powering Modern Web DevelopmentMay 02, 2025 am 12:04 AM

The power of the JavaScript framework lies in simplifying development, improving user experience and application performance. When choosing a framework, consider: 1. Project size and complexity, 2. Team experience, 3. Ecosystem and community support.

The Relationship Between JavaScript, C  , and BrowsersThe Relationship Between JavaScript, C , and BrowsersMay 01, 2025 am 12:06 AM

Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr

Node.js Streams with TypeScriptNode.js Streams with TypeScriptApr 30, 2025 am 08:22 AM

Node.js excels at efficient I/O, largely thanks to streams. Streams process data incrementally, avoiding memory overload—ideal for large files, network tasks, and real-time applications. Combining streams with TypeScript's type safety creates a powe

Python vs. JavaScript: Performance and Efficiency ConsiderationsPython vs. JavaScript: Performance and Efficiency ConsiderationsApr 30, 2025 am 12:08 AM

The differences in performance and efficiency between Python and JavaScript are mainly reflected in: 1) As an interpreted language, Python runs slowly but has high development efficiency and is suitable for rapid prototype development; 2) JavaScript is limited to single thread in the browser, but multi-threading and asynchronous I/O can be used to improve performance in Node.js, and both have advantages in actual projects.

The Origins of JavaScript: Exploring Its Implementation LanguageThe Origins of JavaScript: Exploring Its Implementation LanguageApr 29, 2025 am 12:51 AM

JavaScript originated in 1995 and was created by Brandon Ike, and realized the language into C. 1.C language provides high performance and system-level programming capabilities for JavaScript. 2. JavaScript's memory management and performance optimization rely on C language. 3. The cross-platform feature of C language helps JavaScript run efficiently on different operating systems.

Behind the Scenes: What Language Powers JavaScript?Behind the Scenes: What Language Powers JavaScript?Apr 28, 2025 am 12:01 AM

JavaScript runs in browsers and Node.js environments and relies on the JavaScript engine to parse and execute code. 1) Generate abstract syntax tree (AST) in the parsing stage; 2) convert AST into bytecode or machine code in the compilation stage; 3) execute the compiled code in the execution stage.

The Future of Python and JavaScript: Trends and PredictionsThe Future of Python and JavaScript: Trends and PredictionsApr 27, 2025 am 12:21 AM

The future trends of Python and JavaScript include: 1. Python will consolidate its position in the fields of scientific computing and AI, 2. JavaScript will promote the development of web technology, 3. Cross-platform development will become a hot topic, and 4. Performance optimization will be the focus. Both will continue to expand application scenarios in their respective fields and make more breakthroughs in performance.

Python vs. JavaScript: Development Environments and ToolsPython vs. JavaScript: Development Environments and ToolsApr 26, 2025 am 12:09 AM

Both Python and JavaScript's choices in development environments are important. 1) Python's development environment includes PyCharm, JupyterNotebook and Anaconda, which are suitable for data science and rapid prototyping. 2) The development environment of JavaScript includes Node.js, VSCode and Webpack, which are suitable for front-end and back-end development. Choosing the right tools according to project needs can improve development efficiency and project success rate.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.