安装angular cli

Angular is one of the most popular JavaScript frameworks created and developed by Google. In the last couple of years, ReactJS has gained a lot of interest and has become the most popular modern JS library in the industry. But this doesn’t mean Angular is not important anymore.

Angular是Google创建和开发的最受欢迎JavaScript框架之一。 在过去的几年中,ReactJS引起了很多兴趣,并已成为业界最受欢迎的现代JS库。 但这并不意味着Angular不再重要。

On the contrary, Angular is the second most popular framework after React according to Google Trends (world-wide):

相反,根据Google趋势(全球),Angular是仅次于React的第二受欢迎的框架:

As a front end developer, I have worked with Angular. Now I would like to cover some important features of Angular in my upcoming articles:

作为前端开发人员,我曾与Angular合作。 现在,我想在即将发表的文章中介绍Angular的一些重要功能:

  • Part 1: How to install your first App with the Angular CLI (currently you’re here)

    第1部分:如何使用Angular CLI安装第一个应用程序(当前在这里)

  • Part 2: Angular Components & String Interpolation

    第2部分: 角度组件和字符串插值

  • Part 3: Angular Directives & Pipes

    第3部分 : 角度指令和管道

  • Part 4: One-Way Data Binding in Angular

    第4部分: Angular中的单向数据绑定

  • Part 5: Angular Two-Way Data Binding with ngModel

    第5部分: 使用ngModel进行角度双向数据绑定

In the first part of my Angular for Beginners series, you’re going to learn what Angular & Angular CLI is and how to install your first Angular app by using the CLI.

在我的Angular for Beginners系列的第一部分中,您将学习什么是Angular&Angular CLI以及如何使用CLI安装第一个Angular应用程序。

先决条件 (Prerequisites)

Before starting to learn Angular, I recommend that you become familiar with the following languages if you aren't already:

在开始学习Angular之前,我建议您先熟悉以下语言:

  • HTML, CSSHTML,CSS
  • JavaScript / ES6JavaScript / ES6
  • TypeScript打字稿

If you prefer, you can watch the tutorial video below:

如果愿意,您可以观看下面的教程视频:

什么是角度? (What is Angular?)

Angular is a JavaScript framework developed and maintained by Google for building front-end applications. Let me start first explaining what a framework is…

Angular是Google开发和维护的用于构建前端应用程序JavaScript框架。 让我首先开始解释什么是框架...

什么是框架? (What is a Framework?)

A  Framework is a complete package with its own functionalities & libraries. A Framework has its own rules, you don’t have much flexibility and the project is dependent on the Framework you use. Angular is an example of a framework.

框架是具有其自身功能和库的完整软件包。 框架有自己的规则,您没有太多的灵活性,并且项目取决于您使用的框架。 Angular是框架的一个示例。

Angular has released in 2016 but before Angular, there was AngularJS. One of the most asked questions about Angular is that what is the difference between AngularJS and Angular?

Angular已于2016年发布,但在Angular之前有AngularJS。 关于Angular的最常见问题之一是AngularJS和Angular有什么区别?

AngularJS和Angular (AngularJS vs Angular)

These  2 versions of Angular confuse many developers. AngularJS and Angular are completely different frameworks. Angular versions (like 1, 1.2, 1.5,  etc) are called Angular JS and starting from version 2 and above is called Angular.

这两个Angular版本使许多开发人员感到困惑。 AngularJS和Angular是完全不同的框架。 Angular版本(例如1、1.2、1.5等)称为Angular JS,从版本2及更高版本开始称为Angular。

  • Angular JS → versions from 1.xAngular JS→版本1.x
  • Angular → version 2 and aboveAngular→版本2及更高版本

So  Angular version 2 is a complete rewrite of the AngularJS framework and the newer versions (like 4,5,6 and so on) are minor changes of Angular version 2.

因此,Angular版本2是对AngularJS框架的完全重写,而较新的版本(例如4,5,6等)是Angular版本2的较小更改。

In this article series, you’re going to learn Angular 2+.

在本系列文章中,您将学习Angular 2+。

什么是Angular CLI? (What is Angular CLI?)

CLI  stands for Command Line Interface. Angular has its own official CLI  that helps us with lots of things during the development process.

CLI代表命令行界面。 Angular拥有自己的官方CLI,可在开发过程中为我们提供许多帮助。

Angular CLI is being used for automating operations in Angular projects rather than doing them manually. CLI supports us, developers, in an Angular project  from beginning to end.

Angular CLI用于自动执行Angular项目中的操作,而不是手动执行操作。 CLI从始至终都在Angular项目中为我们开发人员提供支持。

For example, Angular CLI can be used for:

例如,Angular CLI可用于:

  • Configurations, Environment Setup配置,环境设置
  • Building components, services, routing system建筑构件,服务,路由系统
  • Starting, testing and deploying the project开始,测试和部署项目
  • Installing 3rd party libraries (like Bootstrap, Sass, etc.)安装第三方库(例如Bootstrap,Sass等)

and much more. Now let’s see how to install our first Angular App by using the CLI step by step.

以及更多。 现在,让我们逐步了解如何使用CLI安装第一个Angular App。

步骤1:安装NPM(节点程序包管理器) (Step 1: Install NPM (Node Package Manager))

First  of all, we are going to need Node js. NPM (node package manager, is a part of node js) is a tool for installing 3rd party libraries and dependencies to our project. If you don’t have it yet, you can download and install it from here. I have also explained it step by step on the tutorial video.

首先,我们将需要Node js。 NPM(节点程序包管理器,是节点js的一部分)是一个用于将第三方库及其依赖项安装到我们的项目的工具。 如果还没有,可以从这里下载并安装。 我还在教程视频中逐步介绍了它。

步骤2:安装Angular CLI (Step 2: Install Angular CLI)

If you have node js installed, the next step is installing the Angular CLI itself to your computer:

如果您已安装node js,则下一步是将Angular CLI本身安装到您的计算机上:

npm install -g @angular/cli

g stands for global installation. If you use -g later you can use the CLI in any Angular project on your computer.

g代表全局安装 。 如果以后使用-g,则可以在计算机上的任何Angular项目中使用CLI。

Tip: Type ng v to your command-line interface (or terminal) to verify your Angular version.

提示 :在命令行界面(或终端)上输入ng v以验证您的Angular版本。

步骤3:建立新的Angular专案 (Step 3: Create a new Angular Project)

After the installation is completed, you can use Angular CLI to create a new Angular project with the following command:

安装完成后,可以使用Angular CLI通过以下命令创建新的Angular项目:

ng new my-first-app

This  command creates a new Angular project (named my-first-app, you can use any name) with all the necessary dependencies and files. You don’t have to worry about anything because the CLI does it automatically for you.

此命令将创建一个具有所有必要依赖项和文件的新Angular项目(名为my-first-app,您可以使用任何名称)。 您无需担心任何事情,因为CLI会自动为您执行操作。

步骤4:运行应用 (Step 4: Run the App)

After installing the CLI and creating a new Angular app, the final step is to start the project. To do that, we need to use the following command:

安装CLI并创建新的Angular应用后,最后一步是启动项目。 为此,我们需要使用以下命令:

ng serve -- open

The “open” flag opens your local browser window automatically.

“打开”标志会自动打开本地浏览器窗口。

Angular supports live server, so you can see the changes in your local without refreshing your browser’s page. For more details and updates, check also the official documentation.

Angular支持实时服务器 ,因此您可以在不刷新浏览器页面的情况下查看本地更改。 有关更多详细信息和更新,请参阅官方文档 。

结论 (Conclusion)

So in the first part, we’ve made an introduction to Angular, what CLI is and how to install your first Angular app. In the second post, you’re going to learn about Angular Components and String Interpolation. Stay tuned :)

因此,在第一部分中,我们介绍了Angular,什么是CLI以及如何安装第一个Angular应用程序。 在第二篇文章中,您将学习Angular Components和String Interpolation 。 敬请关注 :)

If you want to learn more about Web Development, feel free to follow me on Youtube!

如果您想了解有关Web开发的更多信息,请 随时 在YouTube上关注我

Thank you for reading!

感谢您的阅读!

翻译自: https://www.freecodecamp.org/news/angular-9-for-beginners-how-to-install-your-first-app-with-angular-cli/

安装angular cli

安装angular cli_Angular 9适用于初学者—如何使用Angular CLI安装第一个应用程序相关推荐

  1. 【Sklearn安装】win10+python3适用于初学者

    [Sklearn安装]win10+python3适用于初学者 写在前面 为了写大数据的作业要安装sklearn直接cmd里输入遇到了time out和很多其他问题,写篇博客小记一下. 下载轮子 直接使 ...

  2. python学习自记录(2)开发工具的pycharm安装使用,编写的第一个应声虫程序

    python学习自记录(2)开发工具的pycharm安装使用 1.下载安装 链接:https://pan.baidu.com/s/18ARXYybcoMrRi96gfIh6Zg 密码:qydc 下方注 ...

  3. 写给初学者的Python与pip安装教程

    写给初学者的Python与pip安装教程 在Python编程中,安装包(package)是一个重要的环节.Python本身提供了pip这一安装和管理包的便捷工具,然而目前网上所能找到的有关pip的中文 ...

  4. mac的angular/cli安装及踩坑记录

    一.angular/cli的安装 step1:node+npm安装 首先使用node -v命令查看mac是否已安装node与npm(如已安装则跳过) node -v npm -v 安装Node.js ...

  5. studiolibrary安装_初学者daz studio中文基础安装布局教程

    本视频教程是关于初学者daz studio中文基础安装布局教程 ,时长:10小时,大小:800 MB,MP4高清视格式,教程使用软件:DAZ Studio,语言:英语. 使用方法1:安装软件,直接将C ...

  6. 五、Oracle19c下载、安装和验证(适用于Windows系统)

    五.Oracle19c下载.安装和验证(适用于Windows系统) 1.下载 (1)地址 (2)下载 2.安装 (1)解压下载数据库文件 (2)双击"setup.exe" (3)配 ...

  7. 新能源汽车VCU开发模型及控制策略 新能源汽车整车控制器VCU学习模型,适用于初学者

    新能源汽车VCU开发模型及控制策略. 目前各大行业都纷纷跨行做新能源汽车,紧缺VCU工程师,特别是涉及新能源三电系统,工资仅仅低于无人驾驶.智能驾驶岗位. 内容如下: 新能源汽车整车控制器VCU学习模 ...

  8. 安装VS Code(适用于Win7)

    安装VS Code(适用于Win7) 这学期我有一门<HTML5 混合APP开发>课程,需要用到VS Code,但是我之前没有使用过这个软件,还是有点陌生的,所以分享一下我安装VS Cod ...

  9. Matlab R2018a 中文版安装教程(同时适用于大部分其他版本)

    安装Matlab R2018a时候遇到了一些麻烦,于是自写教程记录安装过程,毕竟以后还要重新换电脑安装.本文基于Win7系统下的安装. 准备工作: 下载完成的Matlab R2018a的文件如下: 其 ...

最新文章

  1. 阅读Book: MultiObjective using Evolutionary Algorithms (2) -- Multi-Objective Optimization: 各种解释多目标
  2. 静态Web服务器-多任务版
  3. 学习计算机视觉你需要知道这关键的八点
  4. python 多维list 排序_人生苦短 | Python列表和元组归纳整理
  5. CentOS 5 全攻略 -- 一步一步配置详解
  6. 大数据对六大领域的挑战
  7. python怎么改背景_python IDE背景怎么改
  8. php会话控制区别和流程,PHP会话控制:cookie和session区别与用法深入理解_后端开发...
  9. 3.Oracle中的函数
  10. Java游戏程序设计教程 第2章 游戏设计的基本流程
  11. 关于新建android项目时 appcompat_v7报错问题的一点总结
  12. phpstorm设置背景图片
  13. 我的第一个app:电信宽带密码一键获取客户端
  14. 跨数据库同步方案汇总
  15. 三维点云处理(深度学习方法)综述
  16. css 预处理器 less sass
  17. 808 Lab虚拟插件:Sample Science 808 Lab for Mac
  18. 用itunes把iphoto已导入到iphone的照片怎么删除?
  19. java8 —— Stream( 流 )
  20. 怎么把收藏夹变成html文件,用Delphi将IE收藏夹导出为HTML文件

热门文章

  1. Redis面试复习大纲在手面试不慌,内含福利
  2. MMKV集成与原理,赶紧学起来
  3. uva 247(floyd传递闭包)
  4. JDBC 数据库连接操作——实习第三天
  5. [阅读笔记]Zhang Y. 3D Information Extraction Based on GPU.2010.
  6. 第一冲刺阶段博客检查
  7. C语言-结构体内存对齐
  8. [转载]UEditor报错TypeError: me.body is undefined
  9. 【leetcode】Median of Two Sorted Arrays
  10. jquery实现饼图统计图表