-
0 votes5 answers148 views
cellRendererFramework没有组件工厂找到ag-grid angular2
尝试将angularRendererFramework(v13.1.2)与angular2一起使用,但却收到此错误: ProductComponentComponent.html:7 ERROR Error: No component factory found for [object Object]. Did you add it to @NgModule.entryComponents? at... -
0 votes0 answers1713 views
angular-cli,ag-grid和ng-packagr
我正在用ng-packagr构建一个使用ag-grid的软件包 . 当我尝试从'ag-grid-angular'导入AgGridModule时,它给出了一个错误,即AggridModule不会被'node_modules \ ag-grid-angular \ main.js'导出 . 当我进入nodes文件夹时,它确实导出了这个模块 . 显示以下输出: 构建Angular库为@ pdbc / p... -
0 votes1 answers863 views
Angular CLI - ng build期间的AOT错误
我使用Angular CLI创建了一个应用程序,它可以与JIT编译一起使用 . 我觉得我需要更快地使我的应用程序,所以我计划将应用程序从JIT转换为AOT . 我按照angular.io提到的说明进行操作 https://angular.io/guide/aot-compiler 这个文件 . 我成功转换了步骤,这有助于我们将所有文件转换为ngFactory,完成了汇总过程而没有错误 . 我执行 ... -
1 votes0 answers47 views
Angular2:配置文件与APP_INITIALIZER - css冲突?
我用angular-cli创建了一个Angular 2 App,它运行得很好 . 自从我在论坛中搜索并按照建议使用APP_INITIALIZER加载外部文件的步骤(如此question) 现在,问题是当我在provider元素中添加 app.module.ts ConfigService时,如下所示: providers: [ ConfigService, { ... -
13 votes2 answers695 views
如何使材料组件与Karma一起在单元测试中使用Angular
我有一个角度CLI项目设置 . 我制作了一个使用角度材质组件的表单,例如 <md-card> . 我刚刚开始编写我的第一个Karma / Jasmine单元测试,遵循angular docs中的步骤 . 这是我的组件模板: <md-card [ngClass]="'dialog-card'"> <md-card-title [ngClass]=&... -
6 votes2 answers37 views
angular-cli:使用环境变量的条件导入
有没有办法根据[email protected]中的环境变量有条件地更改导入?我试图以一种不需要在客户端代码中导入服务的代码更改的方式来实现它,但是在需要时我可以指定一个构建标志来交换模拟服务 . 我尝试使用this post模式: 文件结构:MyServiceMyServiceMock.tsMyServiceReal.tsindex.ts在index.ts中,您可以拥有以下内容... -
13 votes3 answers1657 views
index.ts中导出的自动排序会导致应用程序崩溃
每次我在共享文件夹中生成内容时,都会重建index.ts文件,并按字母顺序放置导出 . 这似乎打破了我的依赖 . 手动更改顺序,以便在具有依赖项的类之前导出依赖项使其再次起作用 . 如果我们有 app/shared/auth.guard.ts : import { Injectable } from '@angular/core'; import { CanActivate, Router, Ac... -
1 votes0 answers530 views
Ng2-charts app没有显示图表
我按照ng2-chart演示页面上的说明进行设置 . 我'm using angular-cli so I also imported the packages using System.JS. Then I copied the demo code, but it won' t显示 . 正在创建画布但未绘制任何图表 . 我的组件和模板代码与here完全相同 . -
5 votes4 answers1041 views
角度错误:'Component ' X ' is not included in a module…'在子模块中声明时
我正在尝试将我的对话框合并到一个Angular模块中,但是我在IDE中遇到了一个linting错误: 组件“X”未包含在模块中,并且在模板内不可用 . 考虑将其添加到NgModule声明中 . 据我所知,您不必导出组件(仅管道和指令)以在其他模块中使用它们 . 尽管存在此错误,应用程序仍会加载并成功运行 . Example Component Definition import { Compo... -
11 votes5 answers1939 views
Angular 6 CLI - >如何构建构建项目库
所以这个问题很基本,但我找不到 . 我通过 ng new my-project 创建了一个新应用程序,然后是 ng g library my-library . 然后我执行了命令 ng build ,但它只是构建我的应用程序,而不是我的库或我的e2e项目 . 这是因为在angular.json中,defaultProject设置为my-project . 我可以将它更改为my-library,然... -
3 votes0 answers1758 views
使用Angular 2的微应用程序
我正在寻找一种架构解决方案,它将帮助我们开发不依赖的不同项目(在开发模式或 生产环境 中) . 我们有4个不同的独立项目,所有这些项目都是SPA Monolith应用程序的一部分,但我们的发布时间不同 . 目前,每个团队都构建他们的Angular 2模块并将其发布到NPM(打字稿) . Shell(业务流程项目)使用所有应用程序,将它们编译为Javascript,然后才能部署 . 问题在于,每当其... -
3 votes2 answers181 views
为什么我的单元测试通过Chrome并且使用PhantomJS失败?
我正在使用Angular2 final(2.0.2)和angular-cli . 我正在尝试将其设置为使用PhantomJS运行单元测试 . 使用Chrome和karma-chrome-launcher运行规范 - 所有测试都通过 . 运行相同的Phantomjs-prebuilt 2.1.13和karma-phantomjs-launcher 1.0.2测试失败 . 我将phantomjs启动器... -
5 votes1 answers130 views
角度2“失败:运行ng测试时无法读取未定义的属性'replace'”
我已经检查了这个问题的github问题,并查看了各种堆栈溢出问题和博客和内容,我找不到解决方案,为什么我在我的角度2应用程序中运行“ng test”时出现此错误 . 这是测试的样子: import { TestBed, async } from '@angular/core/testing'; import { AppComponent } from './app.component'; impo... -
0 votes1 answers54 views
Ng测试 - 可't bind to '值' since it isn' t 'mat-select'的已知属性
我有一个使用Material Design的Angular6应用程序 . 运行'ng test'时,我收到以下错误: 失败:模板解析错误:无法绑定到'value',因为它不是'mat-select'的已知属性 . 我在进口和出口中加入了MatSelectModule . 它在应用程序中工作正常但在测试期间失败 . 材料design.module.ts import { NgModule } f... -
0 votes1 answers123 views
Angularjs2表单文件样本,bootstrap.min.css没有下载
我正在跟踪来自anuglar文件的样本https://angular.io/docs/ts/latest/guide/forms.html 在我的html文件头中,我添加了bootstrap.min.css参考 . 当我刷新它给这个URL的404返回代码 . http://localhost:4200/node_modules/bootstrap/dist/css/bootstrap.min.cs... -
0 votes1 answers560 views
更新angular-cli抛出错误
ABC$ sudo npm install -g [email protected] npm WARN deprecated [email protected]: angular-cli has been renamed to @angular/cli. Please update your dependencies. npm WARN deprecated minimat... -
0 votes0 answers1241 views
角度cli ng构建失败,因为未找到组件@ angular / core
### Versions. @angular/cli: 1.0.1 node: 6.9.5 os: win32 x64 @angular/common: 4.1.0 @angular/compiler: 4.1.0 @angular/core: 4.1.0 @angular/forms: 4.1.0 @angular/http: 4.1.0 @angular/platform-browser: 4... -
1 votes0 answers188 views
Git Pull之后Angular CLI项目缺少模块错误
我正在使用Angular4和Angular / CLI 1.2.1 . 我能初始化很好并使用ng服务在本地运行应用程序 . 然而,在推送到远程git仓库然后在不同的机器上拉下我的工作后 - 我得到错误 . Steps to Recreate1.从远程git repo中拉出使用Angular CLI创建的项目 .2. NPM安装 .3.服务 . Error Messages D:/applicat... -
12 votes2 answers627 views
如何使用angular cli webpack提前编译器
有没有办法使用角度cli的AOT? 我已经安装了模块(@ angular / compiler @ angular / compiler-cli),当我输入ngc -p scr时,它会创建ngFactory.ts文件并将其编译为dist / tsc-out(tsconfig中的angular cli默认值) 不知道如何从这里开始:) 干杯 韩 -
0 votes0 answers1745 views
角度AOT错误
我的Angualr项目加载速度非常慢 . 所以我编译Angular AOT,但输出错误信息 . tsconfig-aot.json: { "compilerOptions": { "target": "es5", "module": "es2015", ... -
1 votes3 answers609 views
即使Angular 2存在,Angular 2也看不到该文件(使用Angular-cli)
实际上我有一个样式表: <link href="../node_modules/@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet"> 该文件存在,Webstorm也在目录中看到该文件,但Angular2无法加载它 . 错误:GET http:// l... -
1 votes2 answers950 views
Angular 2的Component装饰器中的directives属性发生了什么变化?
我正在使用Angular CLI v1.0.0-beta.19-3来构建一个Angular 2网站 . 我生成我的组件如下 ng g component file-upload . 我注意到生成的组件 file-upload.component.ts 如下所示 . @Component({ selector: 'file-upload', templateUrl: './file-upl... -
0 votes2 answers1426 views
Angular 2通过让http请求返回json文件来模拟API
我正在使用Angular CLI构建应用程序,但我遇到了一个问题 . 我正在开发我正在集成的API,因此我需要暂时模拟API响应,以便我可以在前端继续前进 . 在过去,我已经构建了一个没有CLI的应用程序,并且手动设置了webpack,因此我可以告诉它打包某些json文件,然后将我的API请求指向这些文件 . 但是使用Angular CLI我没有看到一种方法可以将json与应用程序打包在一起,至少... -
0 votes1 answers266 views
在导入vendorNpmFile ts-md5时找不到模块'md5'
可能是Ref:Angular2 - Angular-CLI installing lodash - Cannot find module的副本,但对我不起作用 跟随https://github.com/angular/angular-cli/wiki/3rd-party-libs使用https://www.npmjs.com/package/ts-md5导入ts-md 使用npm安装ts-md5导... -
7 votes3 answers823 views
找不到模块'webpack' - Angular
我刚刚将我的项目从angular v5.x迁移到v6.x,现在当我尝试使用 ng serve 启动它时,我得到了: Cannot find module 'webpack' Error: Cannot find module 'webpack' at Function.Module.... 任何帮助? 我清除了节点模块并且: npm cache clean --force npm i... -
13 votes2 answers259 views
Angular 6库共享样式表
如何设置index.scss并将变量,mixins等的全局样式表导入角度6库? Angular CLI生成具有根组件和组件scss的lib,但添加或导入到根组件的样式不可用于子组件 . 默认情况下,封装样式是有道理的,但我找不到任何关于如何设置它的信息或示例 . 使用 "projectType": "application" 可以使用的angular.jso... -
1 votes1 answers1892 views
可以't import ' baconjs'进入Angular 2服务
我正在使用angular-cli创建一个新的Angular 2项目 . 我正在尝试添加'baconjs'npm项目,但没有成功 . 我按照这里的说明进行操作:https://github.com/angular/angular-cli/wiki/3rd-party-libs npm和typings安装工作查找 . 更改angular-cli-build.js文件会导致'vendor/baconjs... -
0 votes1 answers1358 views
Angular(5)cli - Cloudinary - <cl-image>错误
所以, 我正在尝试在我们的网站上实施cloudinary按照说明我有这个: app.module ... import { CloudinaryModule } from '@cloudinary/angular-4.x'; import { Cloudinary } from 'cloudinary-core/cloudinary-core-shrinkwrap'; ... const cl... -
2 votes2 answers240 views
无法使用Angular-cli运行Karma
我遇到了一个奇怪的问题,发生在我的某个项目中,即使使用完全相同的设置也无法在其他项目中重现它 . 每次我尝试运行 ng test 或别名 npm test 我都会收到两个模块丢失的错误( karma-jasmine-html-reporter & karma-coverage-istanbul-reporter ) . 虽然这些模块肯定存在!例如: [email protected] tes... -
70 votes12 answers1355 views
使用Angular-CLI为特定模块创建组件
我开始使用angular-cli,我已经阅读了很多内容,以便找到关于我想做什么的答案......没有成功,所以我来到这里 . 有没有办法为新模块创建组件? 例如: ng g module newModule ng g component newComponent (如何将此组件添加到newModule ??) 因为angular-cli默认行为是将所有新组件放在 app.module 中 . 我想...