angular-cli

CLI tool for Angular
授权协议 MIT License
开发语言 TypeScript
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 巩选
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Angular CLI

Development tools and libraries specialized for Angular

This is the home of the DevKit and the Angular CLI code. You can find the Angular CLI specific READMEhere.

Quick Links

Gitter Contributing Angular CLI

The Goal of Angular CLI

The Angular CLI creates, manages, builds and test your Angular projects. It's built on top of theAngular DevKit.

The Goal of DevKit

DevKit's goal is to provide a large set of libraries that can be used to manage, develop, deploy andanalyze your code.

Getting Started - Local Development

Installation

To get started locally, follow these instructions:

  1. If you haven't done it already, make a fork of this repo.
  2. Clone to your local computer using git.
  3. Make sure that you have Node 12.14 or 14.0 installed. See instructions here.
  4. Make sure that you have yarn installed; see instructions here.
  5. Run yarn (no arguments) from the root of your clone of this project to install dependencies.

Building and Installing the CLI

To make a local build:

yarn build --local

This generates a number of tarballs in the dist/ directory. To actually usethe locally built tools, switch to another repository reproducing the specificissue you want to fix (or just generate a local repo with ng new). Theninstall the locally built packages:

cd "${EXAMPLE_ANGULAR_PROJECT_REPO}"
npm install -D ${CLI_REPO}/dist/*.tgz

Builds of this example project will use tooling created from the previous localbuild and include any local changes. When using the CLI, it will automaticallycheck for a local install and use that if present. This means you can just run:

npm install -g @angular/cli

to get a global install of the latest CLI release. Then running any ng commandin the example project will automatically find and use the local build of theCLI.

Note: If you are testing ng update, be aware that installing all the tarballswill also update the framework (@angular/core) to the latest version. In thiscase, simply install the CLI alone withnpm install -D ${CLI_REPO}/dist/_angular_cli.tgz, that way the rest of theproject remains to be upgraded with ng update.

Debugging

To debug an invocation of the CLI, build and install the CLI for an exampleproject, then run the desired ng commandas:

node --inspect-brk node_modules/.bin/ng ...

This will trigger a breakpoint as the CLI starts up. You can connect to thisusing the supported mechanisms for your IDE, but the simplest option is to openChrome to chrome://inspect and then click on the inspectlink for the node_modules/.bin/ng Node target.

Unfortunately, the CLI dynamically require()'s other files mid-execution, sothe debugger is not aware of all the source code files before hand. As a result,it is tough to put breakpoints on files before the CLI loads them. The easiestworkaround is to use the debugger; statement to stop execution in the file youare interested in, and then you should be able to step around and set breakpointsas expected.

Testing

There are two different test suites which can be run locally:

Unit tests

  • Run all tests: yarn bazel test //packages/...
  • Run a subset of the tests, use the full Bazel target example: yarn bazel test //packages/schematics/angular:angular_test
  • For a complete list of test targets use the following Bazel query: yarn bazel query "tests(//packages/...)"

You can find more info about debugging tests with Bazel in the docs.

End to end tests

  • Run: node tests/legacy-cli/run_e2e.js
  • Run a subset of the tests: node tests/legacy-cli/run_e2e.js tests/legacy-cli/e2e/tests/i18n/ivy-localize-*

When running the debug commands, Node will stop and wait for a debugger to attach.You can attach your IDE to the debugger to stop on breakpoints and step through the code. Also, see IDE Specific Usage for asimpler debug story.

When debugging a specific test, change describe() or it() to fdescribe()and fit() to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.

IDE Specific Usage

Some additional tips for developing in specific IDEs.

Intellij IDEA / WebStorm

To load the project in Intellij products, simply Open the repository folder.Do not Import Project, because that will overwrite the existingconfiguration.

Once opened, the editor should automatically detect run configurations in theworkspace. Use the drop down to choose which one to run and then click the Runbutton to start it. When executing a debug target, make sure to click theDebug icon to automatically attach the debugger (if you click Run, Node willwait forever for a debugger to attach).

Creating New Packages

Adding a package to this repository means running two separate commands:

  1. schematics devkit:package PACKAGE_NAME. This will update the .monorepo file, and create thebase files for the new package (package.json, src/index, etc).
  2. devkit-admin templates. This will update the README and all other template files that mighthave changed when adding a new package.

For private packages, you will need to add a "private": true key to your package.json manually.This will require re-running the template admin script.

Packages

This is a monorepo which contains many tools and packages:

Tools

Project Package Version Links
Angular CLI @angular/cli
Architect CLI @angular-devkit/architect-cli
Schematics CLI @angular-devkit/schematics-cli

Packages

Project Package Version Links
Architect @angular-devkit/architect
Build Angular @angular-devkit/build-angular
Build Optimizer @angular-devkit/build-optimizer
Build Webpack @angular-devkit/build-webpack
Core @angular-devkit/core
Schematics @angular-devkit/schematics

Schematics

Project Package Version Links
Angular PWA Schematics @angular/pwa
Angular Schematics @schematics/angular

Misc

Project Package Version Links
Webpack Angular Plugin @ngtools/webpack
  • 认识 Angular-CLI 开发 Angular 需要很多的工具,比如 Typescript 、 Webpack 、 Karma 等等,这些工具自己去配置会很麻烦,所以 Angular 官方推出了 Angular-CLI 。 Angular-CLI 不仅仅是一个构建 Angular 的工具,而是一个集成了很多工具的平台。 安装 Angular-CLI 新版本已经更名为 @angular/cli

  • 我们可能会发现按照网上的方式下载安装后,使用Angular CLI生成的项目并不是我们想要的Angular的版本,因为在我们没有指定安装版本的前提下,默认会下载最新的版本安装,然而不同的Angular CLI版本在生成项目时默认的使用的Angular的版本又是不一样的,不同版本有些实现又存在差异,所以为开发者造成了很大的麻烦,下面我们来介绍一下安装指定的Angular CLI的方法(本文安装的An

  • 提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 目录 一、安装 Angular CLI 二、Angular CLI 使用 1.命令总览 2.创建应用 3.启动运行项目 4.创建指定的功能文件 4.1  创建一个服务 未完待续。。。​​​​​​​ 一、安装 Angular CLI 执行如下安装命令:  npm install -g @angular/cli 执行成功后就可以执行 C

  •     如果纯手工搭建Angular 2.0的项目结构,会有点复杂,一般我们需要使用一些脚手架,比如Angular-cli。     1.安装Angular-cli      使用npm安装: npm install angular-cli -g      2.新建一个Angular 2.0的基本项目 ng new Project_Name      3.运行Angular 2.0项目 cd Pr

  • Angular6 angular-cli的命令和配置 1. 常用命令 ng new project-name 创建一个新的项目; ng generate (class | directive | pipe | service | component | interface | enum | module) 创建类,指令, 管道, 组件, 接口, 泛型, 模块 ng serve 启动应用 后面可以添

  • 一、angular/cli的安装 step1:node+npm安装 首先使用node -v命令查看mac是否已安装node与npm(如已安装则跳过) node -v npm -v 安装Node.js 下载地址:https://nodejs.org/en/download/ 安装后在cmd中输入:node -v  确认Node.js环境 安装npm npm会随着node的安装一起被安装。 在cmd中

  • 原文链接:http://www.cnblogs.com/bh4lm/p/6638057.html 点击阅读原文 ----------------------------------------------- Angular CLI 使用教程指南参考 Angular CLI 现在虽然可以正常使用但仍然处于测试阶段. Angular CLI 依赖 Node 4 和 NPM 3 或更高版本. 安装 要安

  • npm uninstall -g @angular/cli npm cache verify npm install -g @angular/cli (base) yanghaoyuan@192 ~ % npm uninstall -g @angular/cli npm WARN config global `--global`, `--local` are deprecated. Use `--

 相关资料
  • Angular 是一款十分流行且好用的 Web 前端框架,目前由 Google 维护。这个条目收录的是 Angular 2 及其后面的版本。由于官方已将 Angular 2 和之前的版本 Angular.js 分开维护(两者的 GitHub 地址和项目主页皆不相同),所以就有了这个页面。传送门:Angular.js 特性 跨平台 渐进式 Web 应用 借助现代化 Web 平台的力量,交付 app

  • 即将到来的Angular 2框架是使用TypeScript开发的。 因此Angular和TypeScript一起使用非常简单方便。 Angular团队也在其文档里把TypeScript视为一等公民。 正因为这样,你总是可以在Angular 2官网(或Angular 2官网中文版)里查看到最新的结合使用Angular和TypeScript的参考文档。 在这里查看快速上手指南,现在就开始学习吧!

  • 从头开始创建项目 lint你的代码 运行您的单元测试和端到端测试。 Angular 2 CLI目前只在TypeScript中生成框架,稍后还会有其他版本。

  • 这小节内容是译者加的,因为我认为对于新手而言,学习一个框架是有成本的,特别是对于一个不算简单的技术来说,我希望这篇教程是对新手友好的,所以我首先要让你放心的将时间和精力投入到Angular2 中。那我们先不谈技术细节,先用数据说话。 这里我多说一句,最近看一些文章中谷歌趋势截图,大都没有把范围限定在“编程”上。图中可以看出Vue2非常少,所以在下面比较中不再单独统计。 教程数量 这里我选取的主要是

  • 我们已经在Highcharts Configuration Syntax一章中看到了用于绘制图表的配置 。 下面给出角度计图表的示例。 配置 (Configurations) 现在让我们看一下所采取的其他配置/步骤。 chart.type 将图表类型配置为基于计量。 将类型设置为“规格”。 var chart = { type: 'guage' }; pane 此类型仅适用于极坐标图和角度

  • 角度计图表用于绘制仪表/仪表类型图表。 在本节中,我们将讨论不同类型的角度计图表。 Sr.No. 图表类型和描述 1 角度计 角度表。 2 实心仪​​表 实心图表。 3 Clock 时钟。 4 带双轴的仪表 带双轴的仪表图。 5 VU表 VU表图表。

  • Highcharts Angular 是我们基于 Angular 框架封装的 Highcharts,可以很方便的在 Angular 开发环境中使用 Highcharts 创建交互性图表。 开发环境 确保您的 node, NPM, Angular 已经更新到最新版本。以下是经过测试和要求的版本: node 6.10.2+ npm 4.6.1+ @angular/cli 6.0.0+ Highchar

  • Angular Kickstart 是基于 AngularJS,GulpJS 和 Bower 的完整可伸缩构建系统,能加快 AngularJS 应用的开发。开发者只需关注代码的编写和测试,剩下的工作 AngularJS Kickstart 会帮忙完成。 特性: 5 个简单的任务:gulp serve,gulp serve:dist, gulp serve:tdd, gulp test:unit,