AngularJS environment building tutorial
This article mainly introduces the process of setting up the AngularJS environment for beginners. The features of Angular-cli are mentioned in the article. Let's take a look at it. I hope it can help beginners successfully build an AngularJS environment.
What is AngularJS?
AngularJS is an open source web application framework. It was originally developed in 2009 by MISKO Hevery and Adam Abrons. Now maintained by Google
AngularJS Features
AngularJS is a powerful JavaScript-based development framework for creating Rich Internet Applications (RIA).
AngulajJS provides developers the option (using JavaScript) to write client-side applications in a clean MVC (Model-View-Controller) way.
Applications written in AngularJS are cross-browser compatible. AngularJS uses JavaScript code to automatically handle adaptation to each browser.
AngularJS is open source, completely free, and developed and maintained by thousands of developers around the world. It is released under the Apache License version 2.0.
Overall, AngularJS is a framework for building large-scale, high-performance web applications while making them easy to maintain.
1. Here is a brief introduction to the features of Angular-cli:
Angular-cli can quickly build a framework and create modules, services, classes, directives, etc.;
Yes The function of webpack can realize code separation, on-demand loading, etc.;
automatically configures the development environment, test environment, and production environment, can realize code packaging and compression and hot deployment, and can also realize module testing and end-to-end Test
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 the best practice and can be used in the production environment;
2. Install nodejs
AngularJS needs to use Nodejs, so we need to first To install nodejs, you need to use nodejs. The download address of nodejs is: https://nodejs.org/en/download/,
3. Install npm and cnpm
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 others from the NPM server Write third-party packages 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 complete, we can use the ng command and start creating the project.
4. Project creation
After installing angular-cli, you can directly create the project and execute the command
ng new JustForTest
where JustForTest is the project Name
Executing this command creates 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
Start directly using ng serve.
In this way, you can start the project directly. We enter in the browser: http://localhost:4200 and you can directly access:
5. Import the project
If it is How do we start a project locally if we find it online? 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.
Related recommendations:
Detailed tutorial on how to build a vue, node, and webpack environment with graphic examples
A simple tutorial on how to build a vue environment with detailed examples
The clearest graphic tutorial on building a PHP server environment
The above is the detailed content of AngularJS environment building tutorial. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Dewu APP is currently a very popular brand shopping software, but most users do not know how to use the functions in Dewu APP. The most detailed usage tutorial guide is compiled below. Next is the Dewuduo that the editor brings to users. A summary of function usage tutorials. Interested users can come and take a look! Tutorial on how to use Dewu [2024-03-20] How to use Dewu installment purchase [2024-03-20] How to obtain Dewu coupons [2024-03-20] How to find Dewu manual customer service [2024-03-20] How to check the pickup code of Dewu [2024-03-20] Where to find Dewu purchase [2024-03-20] How to open Dewu VIP [2024-03-20] How to apply for return or exchange of Dewu

After rain in summer, you can often see a beautiful and magical special weather scene - rainbow. This is also a rare scene that can be encountered in photography, and it is very photogenic. There are several conditions for a rainbow to appear: first, there are enough water droplets in the air, and second, the sun shines at a low angle. Therefore, it is easiest to see a rainbow in the afternoon after the rain has cleared up. However, the formation of a rainbow is greatly affected by weather, light and other conditions, so it generally only lasts for a short period of time, and the best viewing and shooting time is even shorter. So when you encounter a rainbow, how can you properly record it and photograph it with quality? 1. Look for rainbows. In addition to the conditions mentioned above, rainbows usually appear in the direction of sunlight, that is, if the sun shines from west to east, rainbows are more likely to appear in the east.

PhotoshopCS is the abbreviation of Photoshop Creative Suite. It is a software produced by Adobe and is widely used in graphic design and image processing. As a novice learning PS, let me explain to you today what software photoshopcs5 is and how to use photoshopcs5. 1. What software is photoshop cs5? Adobe Photoshop CS5 Extended is ideal for professionals in film, video and multimedia fields, graphic and web designers who use 3D and animation, and professionals in engineering and scientific fields. Render a 3D image and merge it into a 2D composite image. Edit videos easily

Testing a monitor when buying it is an essential part to avoid buying a damaged one. Today I will teach you how to use software to test the monitor. Method step 1. First, search and download the DisplayX software on this website, install it and open it, and you will see many detection methods provided to users. 2. The user clicks on the regular complete test. The first step is to test the brightness of the display. The user adjusts the display so that the boxes can be seen clearly. 3. Then click the mouse to enter the next link. If the monitor can distinguish each black and white area, it means the monitor is still good. 4. Click the left mouse button again, and you will see the grayscale test of the monitor. The smoother the color transition, the better the monitor. 5. In addition, in the displayx software we

1. First open WeChat. 2. Click [+] in the upper right corner. 3. Click the QR code to collect payment. 4. Click the three small dots in the upper right corner. 5. Click to close the voice reminder for payment arrival.

With the continuous development of smart phones, the functions of mobile phones have become more and more powerful, among which the function of taking long pictures has become one of the important functions used by many users in daily life. Long screenshots can help users save a long web page, conversation record or picture at one time for easy viewing and sharing. Among many mobile phone brands, Huawei mobile phones are also one of the brands highly respected by users, and their function of cropping long pictures is also highly praised. This article will introduce you to the correct method of taking long pictures on Huawei mobile phones, as well as some expert tips to help you make better use of Huawei mobile phones.

PHP Tutorial: How to Convert Int Type to String In PHP, converting integer data to string is a common operation. This tutorial will introduce how to use PHP's built-in functions to convert the int type to a string, while providing specific code examples. Use cast: In PHP, you can use cast to convert integer data into a string. This method is very simple. You only need to add (string) before the integer data to convert it into a string. Below is a simple sample code

Honor mobile phones have always been favored by consumers because of their excellent performance and stable system. Recently, Honor mobile phones have released a new Hongmeng system, which has attracted the attention and expectations of many users. Hongmeng system is known as the system that "unifies the world". It has a smoother operating experience and higher security, allowing users to experience a new world of smartphones. Many users have expressed that they want to upgrade their Honor mobile phone system to the Hongmeng system. So, let’s take a look at the upgrade tutorial of the Honor mobile phone’s Hongmeng system. firstly, I
