Tag: angular度cli

如何将基于Angular CLI的ng2 / 4应用程序烧烤到Node / Express中,并具有单一回声系统来开发/运行/debugging服务器/客户端应用程序?

我正在尝试使用Angular 2/4为前端创buildNode / Express应用程序。 对于Angular我使用Angular CLI来创build和维护模块/组件/服务。 Angular CLI创build了ng2的胚胎应用程序,并且我可以在开发期间运行/debugging该应用程序。 不过服务器端应用程序是不同的 现在我有两个不同的文件夹结构如下。 \repository | +– server-app | +– server.js | +– package.json | +– client-app | +– main.ts | +– index.html | +– app | +– AppComponent.ts | +– package.json 我正在使用Visual Studio代码作为IDE。 而发展我最终在运行API的节点服务器,然后运行Angular应用程序与“ng服务”。 相信我,开发尤其是debugging越来越痛苦。 如何将基于Angular CLI的应用程序烧烤到Node / Express中,并具有单一回声系统来开发/运行/debugging服务器/客户端应用程序?

没有提供ResourceLoader实现。 无法读取url“xxx.component.html”

刚刚为ASP.Net 2.0安装了一个新的Angular 4框架的微软模板,我用下面的命令安装了Angular CLI: npm install –save-dev @ angular / cli @ latest 使用Visual Studio 2017的应用程序的第一次启动是成功的,但是在我添加一个新的组件后,我得到了以下错误: 没有提供ResourceLoader实现。 无法读取url“todo.component.html” 待办事项组件如下: import { Component, Inject } from '@angular/core'; import { Http } from '@angular/http'; @Component({ selector: 'todo', templateUrl: './todo.component.html' }) export class TodoComponent { public todolist: todo[]; constructor(http: Http, @Inject('BASE_URL') baseUrl: string) { http.get(baseUrl +'api/todo').subscribe(result => { […]

Angular-cli未能正确安装

我想知道你能否帮助我 我试图通过npm命令来安装angular-cli npm install -g angular-cli,但是我得到了很多消息,'ng'命令不起作用。 我得到的一些错误如下 > node-zopfli@1.4.0 install C:\Users\my name\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli 节点pre-gyp安装 – 回落到构build node-pre-gyp ERR! 试过下载: https : //node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.gz node-pre-gyp ERR! 未find针对node-zopfli@1.4.0和node@6.5.0(node-v48 ABI)的预构build二进制文件(使用node-gyp回退到源代码编译)gyp ERR! configuration错误gyp ERR! 堆栈错误:找不到Python可执行文件“python”,可以设置PYTHON envvariables。 gyp ERR! 在failNoPython(C:\ Users \我的名字\ AppData \ Roaming \ npm \ node_modules \ angular-cli \ node_modules \ node-gyp \ lib \ configure.js:449:14) 在C:\ Users \ […]

资产优化中的Angular-cli'JavaScript堆内存不足'

我正在Angular-cli项目中创build一个传单地图。 地图图块本地存储在“资产”文件夹中,因为它是栅格地图。 问题是,当我有很多缩放级别的地图时,我已经有超过280万个图像,大小约为1.1GB,而且会变大。 当我使用ng serve这里是控制台输出(它被卡住@资产优化): ** NG Live Development Server is running on http://localhost:4200. ** 25234ms building modules 69ms sealing 0ms optimizing 0ms basic module optimization 96ms module optimization 1ms advanced module optimization 16ms basic chunk optimization 0ms chunk optimization 1ms advanced chunk optimization 0ms module and chunk tree optimization 179ms module reviving 9ms module […]

在VS 2017 Angular Template中使用Angular cli创build组件

我在我的系统中安装了下面的软件 VS 2017-版本15.3.3 节点版本 – 6.11.3 Angular cli版本 – 1.4.1 我想在VS 2017中使用angular模板中的angular度cli创build组件 下面是我正在做的一步,但没有达到结果 步骤1)在VS2017中使用Angular Template创build一个项目 步骤2)打开Cmd – 在解决scheme之外为.angular-cli.json文件创build一个虚拟ng项目 步骤3)复制粘贴.angular-cli.json文件到我的解决scheme下面的文件夹结构[M:\ VS2017 Projects \ Trail109 \ Trail109] 步骤4)从“root”:“Src”更改为“root”:“ClientApp” 步骤5)然后在cmd中使用cd命令进入解决scheme 第6步),并使用给定的命令安装我的解决scheme的angular/ cli npm install @ angular / cli @ latest –save-dev [M:\ VS2017 Projects \ Trail109 \ Trail109> npm install @ angular / cli @ latest –save-开发] 步骤7)之后,使用cmd中的cd命令进入ClientApp中的组件文件夹 […]

Angular-cli种子项目没有凉亭,咕噜咕噜响,它如何pipe理所有的依赖关系?

我们可以用node和nmp来pipe理依赖关系(js / css),缩小,构build,服务,监视…。 如果是的话,它是如何工作的,为什么人们用npm来使用grunt,gulp,bower?

无法从另一个文件夹访问我的.scss软件包文件

我想检索我的.scss文件,其中包含所有其他.scss文件(所有其他.scss文件都导入到styles.scss文件中)。 我把path放到我的angular度cli文件中,文件仍然不可访问(我的html元素没有应用样式) Angular CLI :从我在npm start上运行的文件夹(项目)(从我想访问的文件夹中添加“../webstyles/src/styles.scss”path) "apps": [ { "root": "src", "outDir": "dist", "assets": [ "assets", "favicon.ico", "app/cms/demo.json" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.app.json", "testTsconfig": "tsconfig.spec.json", "prefix": "cb", "styles": [ "../webstyles/src/styles.scss" ], 我得到的错误是:找不到模块:错误:无法解决该项目中的path…。 对不起,我不能发布文件夹树,但我多次检查,不要以为我在这里犯了一个错误 我有什么select?

Angular找不到模块“net”

当我在简单的Angular CLI应用程序中添加依赖项时 import {Socket} from 'net'; 运行'ng start'时出错 ERROR in C:/IdeaProjects/GethIPC/src/app/app.component.ts (5,20): Cannot find module 'net'

angular4 – 我继续得到即使手动安装portfinder也找不到模块“portfinder”

我不断收到这个错误在我的terminal使用ng服务terminal,我已经尝试='npm install portfinder ,也是npm uninstall -g angular-cli, npm cache clean, npm install npm -g, npm install -g angular-cli ,但没有工作,我一直得到它,我使用npm 3.10.10,Angular4和错误如下: Cannot find module 'portfinder' Error: Cannot find module 'portfinder' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/usr/local/lib/node_modules/angular-cli/commands/serve.js:6:18) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad […]

Angular 2 CLI SCSS内联图像

我正在重新编写一个最初在Compass中编写的网站,但是我现在使用了很多内嵌的base64图像,现在我正在使用Angular2 CLI和node-sass,但是那个函数不可用,还有一个库sass-inline-image,但它需要一些configuration,我不确定把它放在哪里,有人知道如何解决这个问题?