-
2 votes1 answers414 views
用于更新数据的Angular Reactive Forms输入的默认值是'undefined',虽然绑定到value属性而不是占位符
我在Angular中创建了一个可重用的组件,我用它来构建多个表单,以便快速修改多个数据项 . 我在这个组件中有2个输入字段,当我在使用* ngFor的数组上进行迭代时,我通过输入属性进行绑定 . 一切都很好,并且可以很好地使用ID并显示数据,但我遇到的问题是当我推动更新这两个字段的值时显示为'undefined'(除非我修改它们) . 我的标记是: <input #catTit... -
0 votes2 answers1128 views
Angular 7 Reactive Forms无法读取未定义的属性'controls'
我在Angular v7中使用 ReactiveForms . Template <div class="login__container"> <div class="login__form"> <form novalidate [formGroup]="loginForm" (ng... -
1 votes1 answers1174 views
使用动态命名控件进行角度反应式表单验证
在我使用反应式表单的Angular 7应用程序中,我正在基于 *ngFor 循环创建 input 元素,因此我最终得到一个动态命名的输入: <nav class="level" *ngFor="let work of workLeft"> <input [formControlName]="work.abbrev"... -
0 votes2 answers1131 views
Angular 7和Angular Material表在为每行生成下拉列表格式控件时出现数据源错误
基于这个堆栈上的question,我需要为角度材料表 dataSource 生成的每一行绑定一个下拉列表 . 下拉列表应自动选择对应的值,作为其他值 . 这是表: <form [formGroup]="formGroup"> <table mat-table [dataSource]="dataSource" matSort>... -
1 votes1 answers133 views
Angular 7延迟加载验证
我试图从我的应用程序模块延迟加载模块 . 但是,它没有得到延迟加载,以及URL导航无法正常工作 . 当我尝试访问我的延迟加载模块组件时,我得到如下错误.... core.js:14597 ERROR Error: Uncaught (in promise): TypeError: undefined is not a function TypeError: undefined is not a f... -
0 votes0 answers1463 views
错误:StaticInjectorError(AppModule)[NgIf - > ViewContainerRef]:将角度6升级到7后
在我 Build 不同项目的共享模块之后,编译成可安装的npm模块 . 然后,我可以在其他角度项目中使用我的模块 . 之前的角度6中的可共享组件是我以前的项目 . 我今天决定将我的项目升级为角7 . 当我启动项目时,它工作正常并且符合预期 . 但是,在我将它打包成npm install-able并将其安装在其他项目中后,我的项目失败了 RROR错误:StaticInjectorError(App... -
0 votes1 answers1338 views
Angular和Reactive表单数组在表单数组中设置表单控件值,给出错误必须为表单控件名称提供值
我需要将一个特定的活动表单数组的表单控件设置为一个值 . 我使用以下内容: (<FormArray>this.formGroup.get('test')).at(i).setValue(oldFr); i 是应该进行更改的索引, oldFr 是要设置的值 . 但我忘了每个索引中都有多个表单控件 . 我需要设置的表单控件叫做 formControlName="fr"... -
0 votes0 answers322 views
ng2-image-upload预览先前上传的图像
我在我的应用程序中显示以前上传的图像时遇到问题 . this.profiles.filepath //value of this varible is {0: "/uploads/Restaurants/profile/1544420574509-5yg9t54cjphw4u25.jpeg", 1: "/uploads/Restaurants/profile/154... -
-2 votes1 answers189 views
错误:未捕获(在承诺中):错误:StaticInjectorError(AppModule)[String]
Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[String]: StaticInjectorError(Platform: core)[String]: NullInjectorError: No provider for String! 编译我的角度7项目时遇到了上述问题 . 以下解决方案... -
4 votes1 answers1693 views
Angular7 Reactive Forms输入属性值在控制器/组件中不会更改,仅在HTML标记上更改
我制作了一个具有反应形式组的可重用组件 . 我有2个输入属性“名称”和“描述”,我正在使用ngFor设置这些输入属性来迭代组件 . 不幸的是,即使我将表单控件组中的start / default值设置为输入属性,当我单击submit angular时,将这两个输入属性读取为'null'而不是通过input属性设置的值 . 表单组输入属性: @Input() categoryID; @Input... -
1 votes0 answers311 views
Angular 7和Reactive form Array返回错误无法找到带路径的控件
我从服务器获取数据到组件 . 这些数据包含具有多个值的 Family Relation ,可以从下拉列表中选择以更改原始族关系值 . 我想要的是使用Reactive Forms创建一个表单控件输入数组,以显示角度材料表数据源的每一行的下拉列表 . Here is a working stackblitz that give you a great idea of the problem. 这是脚本... -
0 votes2 answers1417 views
Angular 7反应形式如何获取所选值的文本而不是下拉列表表单控件中的值
我有办法获得下拉列表中所选值的文本,而不是以反应形式获取值吗? 我的脚本如下: <form [formGroup]="formGroup" formArrayName="test"> <ng-container matColumnDef="fr" formArrayName="test">... -
-2 votes3 answers569 views
转换为对Angular 7 [暂停]的发布请求
return super.post(this.getFullUrl(url), body, this.requestOptions()) .catch(this.onCatch.bind(this)) .do((res: Response) => { this.onSubscribeSuccess(res); }, (e... -
0 votes0 answers710 views
将分页应用于没有桌子的mat-card
我是agnular 6的新手,想要将分页应用到mat-card . 我在mat-card上显示数据 . 所以下面是我的代码typscript代码 . export class ViewComponent implements OnInit { Questions: IQuestion[]; pageSize: 10; pageLength: 100; pageSizeOption... -
1 votes0 answers1049 views
Angular 6和bpmn-properties-panel
我想在我的项目中使用bpmn.io . 所以我试图将bpmn-properties-panel与Angular集成 . 我安装了所有模块并导入它们 . 但我没有得到他们所展示的所有 properties . 我得到的是图像下方 如您所见,我无法查看特定任务的所有属性 . 我经历了他们的官方论坛Angular 6 and properties-panel 如果我喜欢那样的话 import camu... -
0 votes1 answers528 views
Angular 7拦截器获取本地存储值并添加到标头
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>{ try { const token: any = localStorage.getItem('ibAccessToken'); console.log('token s... -
2 votes1 answers773 views
Angular 7升级:RxJs switchMap和ObservableInput的返回类型<void>
此代码在Angular 6中编译和使用: import { of } from 'rxjs'; import { switchMap } from 'rxjs/operators'; switchMap((term) => { if (term.trim().length > 3) return this.sea... -
0 votes0 answers1611 views
Angular 7订阅无法正常工作(角度7的新功能)
这是服务employee-service.service.ts的代码 import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { IEmployee } from './employee'; import { Observable } from 'rx... -
1 votes1 answers1301 views
库之间的角度6/7循环依赖
我正在开发一个使用Angular 7的项目,我为我构建的应用程序的各个模块提供了各种角度库,然后在(私有)npm上发布以供应用程序使用 . 因此,所有角度库都通过他们的npm包导入到应用程序中 . 我面临的问题是我现在有2个模块相互导入,因为它们需要显示来自其他模块的组件 . 我无法在其他地方移动所述组件,因为它们依赖于自己模块中的服务和其他组件 . 为了让它更清晰一点,我会举一个例子说明我的情况... -
1 votes1 answers1660 views
Angular 7和'a' routerlink ' since it isn' t 'a'的已知属性
我正在创建一个新的Angular 7应用程序,我在过去几天一直在研究这个问题,但是我无法找到这个错误的解决方案"can't bind to 'routerlink' since it isn't a known property of 'a'" . 以下是我查看的一些文章Angular2 Exception: Can't bind to 'routerLink' since i... -
0 votes0 answers4 views
Google Oauth Rediect Link在Angular中抛出错误
我正在使用带有Google身份验证的ux-mode重定向选项,并且添加到重定向网址的查询字符串会导致即时错误 . 登录有效,但此脚本错误导致问题 . 这是错误: core.js:12632 ERROR DOMException: Failed to execute 'querySelector' on 'Document': '#scope=openid email profile https:... -
0 votes0 answers1619 views
在mat-table中验证form-field-input(Angular 7)
我有一个带有mat-input的mat-form-field,它位于一个material-table中 . 由于数据在material-table-datasource中,我不能使用formgroup并以这种方式验证输入 . 有没有其他方法或“解决方法”我可以用来解决这个问题? 该字段设置如下: <ng-container matColumnDef="rate"> ... -
0 votes2 answers567 views
角度保护canActivate方法不适用于Observable <boolean>
我正在尝试在访问路由之前验证后端的令牌 这是我的身份验证服务: export class AuthService { private registerUrl = 'http://127.0.0.1:3000/register'; private loginUrl = 'http://127.0.0.1:3000/signin'; private verifyTokenUrl = 'h... -
0 votes0 answers377 views
Angular 7 CRUD App Service未连接到REST Api
我正在尝试在this tutorial之后使用REST Api构建一个Angular 7 CRUD应用程序 . 简单地说它是一个经典的显示产品,添加,编辑和所有爵士有点应用程序 . Rest API使用Mongoose,Express和Node制作 . Angular App和服务器都可以自行运行 . 当我在cmd中使用mongod时它正在等待一个答案,并且在api中的npm start它确实连... -
-1 votes0 answers1663 views
Angular 7中的ArangoDB 3 CRUD
我正在 生产环境 一个Angular 7项目,我正在尝试确定为CRUD操作安全连接到ArangoDB的最佳方法 . 我正在寻找最好的方法和工作代码示例 . AngularJS的所有内容似乎都适用于我(我也可能不是最好的方法),我也不确定如何为Angular 7实现foxx . 任何帮助或方向都会受到赞赏 . 我搜索了一切,不知道我缺少什么,我似乎只能通过Web UI和CLI使用ArangoDB,... -
0 votes0 answers329 views
我可以动态加载HTML字符串作为组件模板并在Angular 7中完全编译吗?
所以我读到了这个:https://angular.io/guide/dynamic-component-loader 我正在尝试从i18n数据库加载产品描述页面 . 让我们定义REST服务器,例如,请求: { product: "stick", lang: "en" } 将返回: { content: "<div class=&quo... -
0 votes0 answers739 views
StackBlitz无法找到现有的Angular SCSS文件
我正在将应用程序移动到在VSCode中开发的Angular 7 app StackBlitz . angular.json已经过调整,可以与SCSS一起使用 . 其他SCSS文件似乎成功找到 . 但StackBlitz抱怨它无法找到错误消息的确切路径中的文件 . 请指教 . 我附上了一张图片 . -
0 votes1 answers1905 views
最新版本的ngrx错误处理无法正常工作
我正在使用最新版本的ngrx,如何捕获效果中的API错误 . 我尝试了所有教程和各种示例,但似乎没有一个适合我 . 这是到目前为止我正在做的演示的链接:https://stackblitz.com/edit/angular-cru1he 期望:如果api调用失败,我想捕获API错误并触发操作 . -
0 votes0 answers739 views
未选中复选框时,在DB中记录编号
我有这个复选框,当选中或不选中复选框时,它会记录1或0 . <input type="checkbox" id="enabled" class="form-control" name="enabled" [(ngModel)]="terminal.enabled"> 宾语: expor... -
-1 votes0 answers104 views
角度,构建滑块,样式似乎没有被封装?
我需要在角度7中构建一个超级滑块组件 . 我首先从角度材质滑块组件中将源添加到我的项目中 . CSS正在做很多工作 . 当我为我的新滑块(基于角度材料源)修改关联的CSS时,我发现这些触摸会影响所有滑块使用 . 看来我必须为我的滑块重命名这个类,一旦我开始打破整个地方就会变得很尴尬 . 我很困惑为什么我们在组件级别声明一个CSS文件,如果一个css类同名,它似乎全局应用 . 有人可以在这里给出一...