Angular 调试
我们新建一个项目。执行 ng server 会启动一个网站。
1. 执行 where ng 。看看ng 是什么.
D:\Abp学习\angular\Mytest>where ng
C:\Users\QiGongbo\AppData\Roaming\npm\ng
C:\Users\QiGongbo\AppData\Roaming\npm\ng.cmd
实际执行到了ng.cmd:
@IF EXIST "%~dp0\node.exe" ( # C:\Users\QiGongbo\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
"%~dp0\node.exe" "%~dp0\node_modules\@angular\cli\bin\ng" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\node_modules\@angular\cli\bin\ng" %*
)
这个 ng 是个JS文件。 文件是这样的:
#!/usr/bin/env node
'use strict'; // Provide a title to the process in `ps`.
// Due to an obscure Mac bug, do not start this title with any symbol.
console.log(process);
try {
process.title = 'ng ' + Array.from(process.argv).slice().join(' ');
} catch(_) {
// If an error happened above, use the most basic title.
process.title = 'ng';
} // Some older versions of Node do not support let or const.
var version = process.version.substr().split('.');
if (Number(version[]) < || (Number(version[]) === && Number(version[]) < )) {
process.stderr.write(
'You are running version ' + process.version + ' of Node.js, which is not supported by Angular CLI v6.\n' +
'The official Node.js version that is supported is 8.9 and greater.\n\n' +
'Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.\n'
); process.exit();
} require('../lib/init');
最后引用了 require('../lib/init');
init.js 如下:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
require("symbol-observable");
// symbol polyfill must go first
// tslint:disable-next-line:ordered-imports import-groups
const core_1 = require("@angular-devkit/core");
const node_1 = require("@angular-devkit/core/node");
const fs = require("fs");
const path = require("path");
const semver_1 = require("semver");
const stream_1 = require("stream");
const config_1 = require("../utilities/config");
const packageJson = require('../package.json');
function _fromPackageJson(cwd) {
cwd = cwd || process.cwd();
do {
const packageJsonPath = path.join(cwd, 'node_modules/@angular/cli/package.json');
if (fs.existsSync(packageJsonPath)) {
const content = fs.readFileSync(packageJsonPath, 'utf-8');
if (content) {
const json = JSON.parse(content);
if (json['version']) {
return new semver_1.SemVer(json['version']);
}
}
}
// Check the parent.
cwd = path.dirname(cwd);
} while (cwd != path.dirname(cwd));
return null;
}
// Check if we need to profile this CLI run.
if (process.env['NG_CLI_PROFILING']) {
let profiler;
try {
profiler = require('v8-profiler-node8'); // tslint:disable-line:no-implicit-dependencies
}
catch (err) {
throw new Error(`Could not require 'v8-profiler-node8'. You must install it separetely with` +
`'npm install v8-profiler-node8 --no-save.\n\nOriginal error:\n\n${err}`);
}
profiler.startProfiling();
const exitHandler = (options) => {
if (options.cleanup) {
const cpuProfile = profiler.stopProfiling();
fs.writeFileSync(path.resolve(process.cwd(), process.env.NG_CLI_PROFILING || '') + '.cpuprofile', JSON.stringify(cpuProfile));
}
if (options.exit) {
process.exit();
}
};
process.on('exit', () => exitHandler({ cleanup: true }));
process.on('SIGINT', () => exitHandler({ exit: true }));
process.on('uncaughtException', () => exitHandler({ exit: true }));
}
let cli;
try {
const projectLocalCli = node_1.resolve('@angular/cli', {
checkGlobal: false,
basedir: process.cwd(),
preserveSymlinks: true,
});
// This was run from a global, check local version.
const globalVersion = new semver_1.SemVer(packageJson['version']);
let localVersion;
let shouldWarn = false;
try {
localVersion = _fromPackageJson();
shouldWarn = localVersion != null && globalVersion.compare(localVersion) > ;
}
catch (e) {
// eslint-disable-next-line no-console
console.error(e);
shouldWarn = true;
}
if (shouldWarn && config_1.isWarningEnabled('versionMismatch')) {
const warning = core_1.terminal.yellow(core_1.tags.stripIndents `
Your global Angular CLI version (${globalVersion}) is greater than your local
version (${localVersion}). The local Angular CLI version is used. To disable this warning use "ng config -g cli.warnings.versionMismatch false".
`);
// Don't show warning colorised on `ng completion`
if (process.argv[] !== 'completion') {
// eslint-disable-next-line no-console
console.error(warning);
}
else {
// eslint-disable-next-line no-console
console.error(warning);
process.exit();
}
}
// No error implies a projectLocalCli, which will load whatever
// version of ng-cli you have installed in a local package.json
cli = require(projectLocalCli);
}
catch (_a) {
// If there is an error, resolve could not find the ng-cli
// library from a package.json. Instead, include it from a relative
// path to this script file (which is likely a globally installed
// npm package). Most common cause for hitting this is `ng new`
cli = require('./cli');
}
if ('default' in cli) {
cli = cli['default'];
}
// This is required to support 1.x local versions with a 6+ global
let standardInput;
try {
standardInput = process.stdin;
}
catch (e) {
delete process.stdin;
process.stdin = new stream_1.Duplex();
standardInput = process.stdin;
}
cli({
cliArgs: process.argv.slice(),
inputStream: standardInput,
outputStream: process.stdout,
})
.then((exitCode) => {
process.exit(exitCode);
})
.catch((err) => {
console.error('Unknown error: ' + err.toString());
process.exit();
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvYW5ndWxhci9jbGkvbGliL2luaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7O0dBTUc7QUFDSCw2QkFBMkI7QUFDM0IsZ0NBQWdDO0FBQ2hDLHlEQUF5RDtBQUN6RCwrQ0FBc0Q7QUFDdEQsb0RBQW9EO0FBQ3BELHlCQUF5QjtBQUN6Qiw2QkFBNkI7QUFDN0IsbUNBQWdDO0FBQ2hDLG1DQUFnQztBQUNoQyxnREFBdUQ7QUFFdkQsTUFBTSxXQUFXLEdBQUcsT0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUM7QUFFL0MsU0FBUyxnQkFBZ0IsQ0FBQyxHQUFZO0lBQ3BDLEdBQUcsR0FBRyxHQUFHLElBQUksT0FBTyxDQUFDLEdBQUcsRUFBRSxDQUFDO0lBRTNCLEdBQUc7UUFDRCxNQUFNLGVBQWUsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSx3Q0FBd0MsQ0FBQyxDQUFDO1FBQ2pGLElBQUksRUF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cbiJdfQ==
Angular 调试的更多相关文章
- angular 调试 js (分 karms protractor / test e2e unit )
首页订阅 Protractor端到端的AngularJS测试框架教程 2014年01月18日 分类:教程, JavaScript, AngularJS Protractor是一个建立在WebDrive ...
- ngModel 值不更新/显示
angular中的$scope是页面(view)和数据(model)之间的桥梁,它链接了页面元素和model,也是angular双向绑定机制的核心. 而ngModel是angular用来处理表单(fo ...
- web开发者谷歌浏览器常用插件
1.Allow-Control-Allow-Origin 安装此插件解决跨域问题,在本地起服务器可访别的域的数据. 需在Access-Control-Expose-Headers加上Allow- ...
- 【angularJS】学习笔记
一.一个html中多个ng-app //对于ng-app初始化一个AngularJS程序属性的使用需要注意,在一个页面中AngularJS自动加载第一个ng-app,其他ng-app会忽略 //如果需 ...
- vscode调试angular
之前在Asp.net MVC + Angular1 的项目中,要调试前台代码都是用浏览器的开发者工具,使用正常,也没有感觉太大的不方便. 后来接触Angular2项目,因为它是要经过编译的,所以在浏览 ...
- VS Code直接调试Angular代码
安装VS Code扩展 安装Debugger for Chrome 安装Debugger for Firefox 配置Launch.json文件 Launch.json文件的创建和生成我们可以利用VS ...
- 在VS CODE中调试Angular代码
Chrome Dev Tools 可以调试js程序,但是可能需要和源码之间来回切换. 如果是使用VS CODE来开发Angular,可以直接在VS CODE中调试. 按照如下的步骤即可: 第一步, ...
- Visual Studio Code 通过 Chrome插件Type Script断点调试Angular 2
1. 下载Visual Studio Code (https://code.visualstudio.com/) 2. 安装插件Debugger for chrome 3. 确定tsconfig.js ...
- VS Code 调试 Angular 和 TypeScript 的配置
一.安装插件 在 Visual Studio Code 中打开扩展面板(快捷键 Ctrl+Shift+X),搜索安装 Debugger for chrome 插件). 二.配置启动参数 在 Visua ...
随机推荐
- osg fbx 模型结构操作
osg::Node* TeslaManage::findOsgNodeByName(QString &nodeNme) { osg::Node* findNode = NULL; std::v ...
- java生成RSA公私钥字符串,简单易懂
java生成RSA公私钥字符串,简单易懂 解决方法: 1.下载bcprov-jdk16-140.jar包,参考:http://www.yayihouse.com/yayishuwu/chapter ...
- MySQL数据库表的设计和优化(上)
一.单表设计与优化: (1)设计规范化表,消除数据冗余(以使用正确字段类型最明显):数据库范式是确保数据库结构合理,满足各种查询需要.避免数据库操作异常的数据库设计方式.满足范式要求的表,称为规范化表 ...
- Java不写文件,LOAD DATA LOCAL INFILE大批量导入数据到MySQL的实现(转)
MySQL使用load data local infile 从文件中导入数据比insert语句要快,MySQL文档上说要快20倍左右.但是这个方法有个缺点,就是导入数据之前,必须要有文件,也就是说从文 ...
- DB2存储过程简单示例
在这个示例中,我们将在DB2中创建一个名为DEMO1201的存储过程. 该存储过程的输入参数IN_NAME和IN_CREDITCARD,表示用户的姓名和身份证号. 该存储过程的作用是根据身份证号来新建 ...
- 车道线检测github集锦
re1. github_lane_detection; end
- iOS-KVO(转)
参考学习网址:http://blog.sina.com.cn/s/blog_71715bf8010166ut.html KVO就是NSKeyValueObserving的缩写,它也是Foundatio ...
- 日常工作问题解决:使用vmvare克隆centos6虚拟机造成无eth0的解决办法
目录 一.问题描述 样本虚拟机配置有两张网卡,eth0.eth1,使用vmvare克隆虚拟机后,复制的虚拟机,没有网卡eth0,eth1,而是有eth2.eth3,如下所示: 二.原因分析 复制系统中 ...
- 【转载】熟练利用google hacking来辅助我们快速渗透
转载于:https://klionsec.github.io/2014/12/14/search-hacking/?tdsourcetag=s_pcqq_aiomsg 0x01 google hack ...
- Memory Barriers Are Like Source Control Operations
From: http://preshing.com/20120710/memory-barriers-are-like-source-control-operations/ If you use ...