腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
视频
沙龙
2
回答
将组件分配给@component下的声明项会引发编译错误
angular
、
angularjs-directive
不确定为什么组件不能分配给@component的声明性属性。父语句中的此语句(指令: ChildComponent)引发编译错误。我的代码的目的是将一个数据值从父传递给子。我听说RC6声明不起作用,所以我在ngModule声明中声明了子组件,编译错误被解决了,但无法在子视图中获取数据。 Parent component: import { Component } from '@angular/core'; import {ChildComponent} from './child-input.component' @Component({ selector
浏览 1
提问于2017-11-24
得票数 1
1
回答
为什么通过数组传递的@输入角在没有使用EventEmitter发送发出的情况下被更新?
angular
我不明白为什么角更新一个属性this.list在没有使用@Output EventEmitter的情况下在组件中进行修改,我注意到只有在传递数组时才会发生这种情况。 import { Component, OnInit } from "@angular/core"; import { Item } from "./models/item"; @Component({ selector: "app-root", templateUrl: "./app.component.html", styleUrls: ["
浏览 5
提问于2021-08-01
得票数 0
回答已采纳
2
回答
当输入更改值时,角度分量不更新
angular
、
rxjs
所以我有一个组件,它接受一个对象的值。我让外部div订阅了一个行为主题。当我使用next()更新behavior subjects值时,容器div的标题也会更新,但内部组件拒绝重新呈现。我是不是做错了什么? 下面是我的控制器中的behavior主题,这是在ngOnInit方法中调用的,在html中的按钮单击时调用的更新方法: ngOnInit() { this.selectedRole$.next({ name: 'Current Permissions', permissions: this.getUserPermissions() } showRoleDetails(
浏览 0
提问于2020-01-14
得票数 3
2
回答
函数ngOnChanges()在Angular 5中不起作用
javascript
、
angular
、
typescript
、
ngonchanges
我试图在我的Angular 5.x组件中调用ngOnChanges()函数,每当组件生命周期或模板中的变量this.test发生更改但它不起作用时,ngOnChanges()函数不会在任何时候调用。有人能帮帮我吗? src/app.ts: import {Component, NgModule, Input, OnChanges, SimpleChanges} from '@angular/core' import {BrowserModule} from '@angular/platform-browser' @Component({ selector:
浏览 3
提问于2018-02-07
得票数 3
回答已采纳
1
回答
如何在角4中打印子组件内的父值
angular
、
typescript
我是angular4的新手 我有一个注册过程,其中包含多个步骤,所以我只是hide/showing我的步骤的一些条件的基础。因此,注册过程包含父组件和子组件(“侧栏”显示用户在最后一步中填写的值)。 我将一个数组从父传递到子。在每一步中,我都用一些值更新数组。当我用子HTML打印数组时,它可以正常工作,但是当我试图在子compenent.ts中控制台相同的数组时,它却什么也没有显示。我必须做一些计算,就像在我的数组中,我有出生日期,所以我想计算用户的实际年龄,并在侧边栏上显示相同的年龄。 这是我的数组: MyArray,这是我传递数组的方式 Parent.html <app child
浏览 1
提问于2018-02-17
得票数 0
回答已采纳
1
回答
两个组件的数据绑定有问题
angular
我对数据绑定有两个方面的问题。第一个以对象的形式发送数据,第二个作为对象迭代并以输入输出数据(value是每个元素的值)。当输入值发生变化时,我希望更改第一个组件中对象的值。 第一组分 test: any; this.test= await this.authService.getMultilingual('en'); - ts <form > <app-iteration-multilingual *ngIf="test" [(array)] = 'test'></app-iteration-multi
浏览 0
提问于2019-06-02
得票数 0
1
回答
AngularJS单向绑定问题
angularjs
我在MainCtrl中有一个对象,并通过单向绑定将其传递给子组件。当我在子模板中更改它时,在MainCtrl中更改父对象。我的问题在哪里? (function(angular) { 'use strict'; angular.module('heroApp', []).controller('MainCtrl', function MainCtrl() { this.hero = { name: 'Spawn' }; }); })(window.angular); (function(angular) {
浏览 3
提问于2017-06-29
得票数 1
回答已采纳
3
回答
如何访问typescript中的组件
javascript
、
html
、
angular
、
typescript
我有一个基本的Angular应用程序,如下所示: app.component.html: <head> <title> My Home Page </title> </head> <body> <h1>Test Umgebung</h1> <div> <label>Firstname</label> <input placeholder="Firstname"/> </div> <div> <la
浏览 9
提问于2021-11-16
得票数 0
1
回答
为什么父组件能够从Angular服务获得可观察类型的数据,但是父组件不能将数据传递给子组件?
angular
父组件正确显示数据,但没有将异步填充的数据发送给子组件 我是Angular的新手,我从这个页面开始关注它的文档:https://angular.io/guide/component-interaction我能够使用Angular服务异步地将文件详细信息读入父组件。当我显示来自父组件的文件详细信息时,我可以看到文件被正确读取。当我使用@Output()变量传递数据并使用@Input在子组件中接收数据时,我得到的是空数据,就好像子组件同步而不是异步地接收输入一样。 以下是该服务: import { Injectable } from '@angular/core'; import
浏览 15
提问于2019-09-07
得票数 0
回答已采纳
6
回答
@Input()在Angular中用来做什么?
angular
、
typescript
我正在研究angular.io上的教程,然后我注意到了@Input装饰器属性: // src/app/hero-detail/hero-detail.component.ts import { Component, OnInit, Input } from '@angular/core'; import { Hero } from '../hero'; @Component({ selector: 'app-hero-detail', templateUrl: './hero-detail.component.html'
浏览 0
提问于2017-08-18
得票数 63
1
回答
如何用@ how ()来编写角子组件的单元测试
angular
、
testing
我必须用@ test ()为子组件编写一个测试。输出是一个对象,用于在从父对象接收后填充值。我试着写了一份似乎没能通过的考试。任何帮助都将不胜感激,新手到角度,非常新手测试。 我的测试看起来如下: import { async, ComponentFixture, TestBed, } from '@angular/core/testing'; import { MetricsComponent } from './scenario-flow.component'; describe('MetricsComponent', () => {
浏览 0
提问于2019-08-07
得票数 2
1
回答
changedetection是否在其模板中只有带属性绑定的子选择器的父组件上运行
angular
、
angular2-changedetection
我想知道如果父组件没有在自己的视图中呈现数组,而是通过@Input()将其发送给子组件,那么角度变化检测是否在父组件上运行? 据我所知,changedetection只运行在视图中呈现的项目。在这种情况下,当数组通过属性绑定传递给子元素时,Angular是否将该数组视为在父组件视图中呈现的内容? 我知道对于子级,您可以设置changedetectionstrategy.onpush,然后它将只检测对@Input()的更改
浏览 24
提问于2019-05-03
得票数 0
回答已采纳
2
回答
ngOnChanges会更新输入属性吗?
javascript
、
angular
我是Angular的新手,只是在ngOnChanges上有一个问题。我知道ngOnChanges()方法接受一个参数(包含来自“@angular/ SimpleChange”的核心),我们可以这样检索最新的变更值: import { Directive, ElementRef, Input, SimpleChange } from "@angular/core"; ... @Input("pa-attr") bgClass: string; ngOnChanges(changes: { [property: string]: SimpleChange })
浏览 2
提问于2019-10-31
得票数 0
2
回答
按角度将数组从一个组件传递到另一个组件
javascript
、
angular
在我的角度应用程序中,我试图将数组playlist从一个组件(1)传递给另一个组件(2)。最好的方法是什么。@输入? Component1.ts import { Component, OnInit } from '@angular/core'; import { ApiService } from '../../../services/api.service'; import { FormGroup, FormControl } from '@angular/forms'; import { FormBuilder } from '@a
浏览 1
提问于2019-11-22
得票数 0
1
回答
当我单击子组件的输入时,会显示一个div,如何一次创建一个或隐藏其他组件?
angular
我有一个名为'mycomponent‘的子组件,代码如下: import { Component,Input } from "@angular/core"; @Component({ selector: "mycomponent", templateUrl: "./mycomponent.html" }) export class MyComponent { @Input() myArray: any; bShow:boolean=false; constructor() { } } <input type="text
浏览 0
提问于2020-09-03
得票数 0
1
回答
似乎无法掌握用服务器上的数据填充可观察到的
angular
、
angular2-services
我对Angularjs相当精通,但我对角很陌生,很难用我对服务器的服务调用来填充组件中可观察到的内容。 该服务很好,并返回了我正在寻找的东西,但填充可观察的似乎不起作用。 这是我的组成部分: import { Component, OnInit } from '@angular/core'; import { Campaigns } from '../campaigns'; import { CampaignListService } from './campaign-list.service' import { Subscription, Ob
浏览 4
提问于2017-07-02
得票数 0
回答已采纳
2
回答
如何启用按钮删除数组中的项?
javascript
、
reactjs
、
arrays
我有一个任务需要我创建一个按钮来删除数组中的某些项目。我已经将一个数组作为支柱传递给子组件()。现在,在子组件中,每当我单击delete按钮时,它似乎就不起作用了,而且我很难找到问题。 下面是代码的链接:(App.js) function App() { const [input, setInput] = useState(""); const [list, setList] = useState([]); const handleSubmit = (e) => { e.preventDefault(); setList([...
浏览 4
提问于2022-07-11
得票数 0
2
回答
嵌套的反应式表单始终有效
angular
、
angular-reactive-forms
我使用嵌套的反应形式作为FormControl。 这是演示 问题:即使嵌套无效,主窗体也是有效的(请尝试清除必填字段)。 如何通知主窗体有关嵌套窗体有效性的更改? 主要的表单组件: import { Component, Input } from '@angular/core'; import { FormBuilder, FormGroup, ControlContainer, NgForm, Validators } from '@angular/forms'; @Component({ selector: 'my-app', te
浏览 6
提问于2018-12-15
得票数 0
3
回答
在按钮单击时将输入变量以角度传递给另一个组件
javascript
、
html
、
angular
我来自Python背景,但我开始尝试学习Angular,但我真的遇到了麻烦。在组件之间工作让我感到困惑,我也搞不懂。我举了一个很好的例子,我认为如果有人帮助我,将有助于理解Angular。 我只有两个组件:一个"header“组件和一个app组件。在header组件中,我要求输入用户名,然后他们单击一个按钮,然后它应该在下一个组件中显示"Hello {{ name }}“。至少可以说,我不能让它工作,这真的很令人沮丧。头部分似乎工作正常,但它根本不能与其他组件通信。无论是按钮部分还是"name“部分都不起作用,所以当涉及到从父组件监听时,我显然误解了我需要做的事情。 这
浏览 0
提问于2018-11-03
得票数 3
回答已采纳
1
回答
离子惰性加载子数组中的模块
angular
、
ionic-framework
、
lazy-loading
、
angular-routing
、
ionic4
我有一个离子应用程序,在Page module下面有一个List Page Module和一个Subdir Page Module。下面是文件夹结构-> list/subdir. problem :当我导航到localhost:8100/list/subdir而不是Subdir page加载时,我遇到了总是加载List page module的问题。 Outcome:我希望在导航到localhost:8100/list/subdir时加载Subdir page;但它加载的是List page。我只想在URL为localhost:8100/list时加载List pa
浏览 54
提问于2019-06-05
得票数 1
2
回答
角5从一个部件到另一个分量的传递模型
angular5
问题 我使用角5作为SPA。我有两个组成部分的父母子女。我从父组件中调用了一个API,并将该API的响应转换为Model。现在我想把这个模型传递给其他组件。我已经使用@Input来获取模型,但是它在视图中呈现,但没有捕捉到组件。当我console.log传递给我的那个模型时,它显示了我的未定义。 代码 import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialog} from "@angular/material"; import {Spec
浏览 3
提问于2018-05-18
得票数 1
回答已采纳
1
回答
如何防止父母将值传递给子值,直到该值可用为止
angular
、
typescript
我知道我必须使用@Input()装饰器,而且我正在这么做。但我使用的是异步操作。我的问题是,父级有时会将空数组或半填充数组发送给子数组。这是我的代码: parent.component.ts import { Component, EventEmitter, Output, OnInit, Input, OnChanges } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; ... @Component({ selector: 'app-
浏览 0
提问于2021-02-15
得票数 0
回答已采纳
1
回答
将集合以角形式传递给子组件
angular
、
set
、
angular-directive
我有一个由id: number()标识的复选框列表。如果我选中第一个复选框,那么id值将存储到Set中。 我的ParentComponent如下: parent.component.ts代码段 import { Component, OnInit } from '@angular/core'; import * as FilterFunc from 'src/assets/FilterFunction.json'; const Filters: any = FilterFunc; @Component({ selector: 'parent
浏览 0
提问于2019-05-14
得票数 0
回答已采纳
2
回答
在控制台中看不到@Input的值,但在HTML中可用
angular
在我的Angular 4项目中,我从父组件传递了一个值,该值是通过服务调用传入的。子组件正在接收该值,并且在我的HTML中也可用。但是当我在我的子组件typescript文件中安慰传递的值时,它显示为undefined。 下面是我的代码片段: restaurantlayout.component.ts (主元件ts文件): import { Component, OnInit, Input } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Restau
浏览 2
提问于2018-05-04
得票数 1
1
回答
角度:检测父组件数据的变化
angular
、
typescript
、
angular-datatables
我有一个父组件,它调用一个数据服务。在这个组件中,我定义了我的列: tableInterventionsColumns: TableColumn<Interventions>[] = [ { label: 'Date', property: 'dateIntervention', type: 'text' }, { label: 'Type', property: 'TypeIntervention', t
浏览 1
提问于2021-03-09
得票数 0
回答已采纳
5
回答
尝试使用输入装饰器将对象从api传递给子组件
angular
、
input
、
angular-decorator
我有一个父组件,它使用服务从api接收数据。我需要将此数据传递给子组件,因为我不想再次调用api (严格规则)。我可以访问父组件中的数据,但不能在子组件中获取数据。我试过很多不同的方法。 import { Component, OnInit, ViewChild } from '@angular/core'; import {ActivatedRoute} from "@angular/router"; import {SwapiService} from "../../models/swapi.service"; import {Starshi
浏览 9
提问于2020-11-17
得票数 0
1
回答
如何使用不同的输入多次调用同一组件并将其显示在同一页面中
angular
、
angular6
、
components
、
multiple-instances
我有一个包含少量脚本的父组件。我有一个子组件,它将显示有关脚本的详细信息。我每次都会将脚本名称作为输入传递给我的子组件。我从服务器获取详细信息,并将其显示在child.html页面中。 在这里,当我每次单击一个脚本时,旧的脚本详细信息将替换为新的脚本(单击的脚本)详细信息。我不希望我的旧脚本细节在我单击新脚本时消失 我是angular的新手。有人能帮我一下吗。基本上,我希望为不同的输入多次加载相同的组件,并显示所有together.Below只是我试图实现的一个代码示例。 parent.html parent.html <li> script1 <li> <l
浏览 16
提问于2019-04-02
得票数 1
回答已采纳
1
回答
如何使用angular6从一个组件传递来自另一个组件的对象
angular6
我对angular是个新手。我正在创建表单,提交表单后,我将在object中获取数据。我需要将该对象传递给另一个组件,是否可以使用@Input属性。如果是,我们如何使用@Input属性来实现这一点。请帮帮我。 parent.component.html <form [formGroup]="addForm" (ngSubmit)="onSubmit()"> Name: <input type="text" formControlName="name" placeholder="Name
浏览 19
提问于2019-07-09
得票数 1
2
回答
使用@Input组件的父级和子级之间的角通信不起作用,但不会产生错误
angular
通过遵循本教程,我正在学习角组件之间的通信: 在我的项目中,复制了父组件: import { Component } from '@angular/core'; @Component({ selector: 'app-parent', template: ` <app-child [childMessage]="parentMessage"></app-child> `, styleUrls: ['./parent.component.css'] }) export cl
浏览 0
提问于2019-05-03
得票数 0
回答已采纳
3
回答
Angular:将消息从父级传递到子级不起作用
angular
我试图将一个值从父级传递到子级。但该消息仅显示在父组件中,而不显示在子组件中。我的代码出了什么问题?或者我需要在app.module中导入某些内容 父级: @Component({ selector: 'app-neues-spiel', template: ` <app-seating-order [childMessage]="parentMessage"></app-seating-order> `, styleUrls: ['./neues-spiel.component.scss']
浏览 0
提问于2018-01-24
得票数 1
3
回答
Angular2中的@Input和@Output有什么区别
angular
我刚开始学习Angular2,遇到了@Input和@Output。两者之间的区别是什么?
浏览 0
提问于2016-10-17
得票数 12
2
回答
如何在组件中使用ionViewDidLoad()?
angular
、
typescript
、
components
、
ionic3
你好,我在ionic 3上工作,我的数据存储在本地存储中。我想在组件中使用这些数据,但ionViewDidLoad (它在正常页面中工作得很好)在组件上不起作用,我得到了以下错误: 那么,还有其他的建议吗? 组件代码(offre.ts): import { Component, Input , Output } from '@angular/core'; import { AngularFireDatabase, FirebaseListObservable } from "angularfire2/database"; import { I
浏览 1
提问于2017-08-09
得票数 0
1
回答
在同步的两个组件之间交换数据和事件
angular
、
typescript
、
angular7
我是新来的,用角7开始一些代码,我有个问题。 我创建了两个组件和一个服务。当在组件searchbar中单击按钮时,服务将检索数据。我想在search-res视图中显示它。服务有要从searchbar组件获取的数据。 这是服务代码: import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http' import { Observable } from 'rxjs'; @Injectable({ providedIn:
浏览 0
提问于2019-01-25
得票数 0
2
回答
指令不能在组件之外工作。
typescript
、
angular
、
angular2-directives
我有一个角2 Directive,如下所示: import { DOM } from 'angular2/src/platform/dom/dom_adapter'; import {Directive, ElementRef, Renderer} from 'angular2/core' @Directive({ selector: '[headerBG]', host: { '(click)': 'onClick()' } }) export class HeaderB
浏览 6
提问于2016-05-21
得票数 3
回答已采纳
1
回答
Angular 9中的单例服务不工作
javascript
、
angular
、
typescript
我正在使用单例服务来存储共享数据。服务代码如下: import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class UploadedFileService { private upLoadedFile: File; constructor() { } public setUploadedFile(file: File) : void { this.upLoadedFile = file; } public
浏览 17
提问于2020-04-26
得票数 1
回答已采纳
1
回答
是否可以使用Input()将变量绑定到id或类
html
、
angular
、
typescript
在Angular 9中,有没有一种方法可以将变量绑定到类或id?我想将惟一的id或类从父组件传递给子组件,并尝试使用Input(),但class/id只显示了我分配给它的实际变量名。 例如: 子组件 HTML文件 <div id="uniqueId"></div 打字脚本 @Input() uniqueId: string; 父组件 HTML <child-comp *ngFor="let data of dataArray let i=index" [uniqueId]="id-{{i}}">
浏览 0
提问于2020-09-02
得票数 0
3
回答
以角形式将值从父组件传递到子组件
angular
我正在尝试构建一个angular组件,它基于父元素提供的src、宽度和高度来显示图像。 这是我的密码: my-image-logo.component.html <img #imgDiv src="{{name}}" > my-image-logo.component.ts export class MyImageLogoComponent implements OnInit { @Input() name; @Input() width = "100px"; @Input() height = "100px"
浏览 0
提问于2018-11-09
得票数 0
2
回答
@Input:双向数据绑定不工作
angular
、
data-binding
我正在尝试复制这个: (这个柱塞是工作的例子,我希望得到相同的结果,但是用我的代码,它不起作用) ================================================================== 我有这个简单的双向绑定,我正在尝试更新一个字符串属性,比如父属性和子属性。 问题:当单击“来自父的更新”时,两个绑定更新。但是当点击“从子更新”时,只有孩子更新! 这似乎很简单,我能做错什么呢? (注意:我使用了角CLI来运行这个项目) =================================================================
浏览 2
提问于2016-11-22
得票数 13
1
回答
为反应式窗体创建自定义组件,在Angular上包装输入控件
angular
、
typescript
我正在尝试创建一个内部带有输入表单控件的自定义组件,但我不知道如何将指令formControl和formControlName连接到内部输入,这是我的代码: <div class="input-group"> <input class="form-control form-control-sm" #code /> <div class="input-group-append"> <button type="button" class="
浏览 1
提问于2020-02-13
得票数 0
1
回答
如何在角2中将值从子部件传递给父组件?
html
、
angular
我需要从子组件中获取数据。我的子组件有以popu表示的表单。如何将全部详细信息传递给父组件。我的父组件ts文件是 import { Component, OnInit } from '@angular/core'; import {MdDialog, MdDialogRef} from '@angular/material'; @Component({ selector: 'app-vehicle-relocate', templateUrl: './vehicle-relocate.component.html
浏览 2
提问于2017-04-27
得票数 2
回答已采纳
2
回答
值未在父级和子级之间正确传递
angular
、
typescript
我是Angular2的新手,出于练习的目的,我创建了一组3个输入组件,其中有一个用于擦除输入的值的重置按钮。我想测试@Input装饰器,以及如何将值从父级传递到子级。我的代码中的问题是该按钮只擦除一次值 以下是代码,父组件: import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: ` <button (click)="reset()">Reset Age</button> <a
浏览 0
提问于2017-09-08
得票数 1
1
回答
变量从一个部件到另一个部件不工作在角9中。
angular
、
angular9
我在角9.1.3里工作。 我有两个组件admin和header。我必须打印/传递变量从admin到header组件。但是说变量是undefined。 我的管理组件:admin.component.ts import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { AuthService } from '../auth.service'; import { first } from 'rxjs/ope
浏览 4
提问于2020-05-14
得票数 0
1
回答
组件间的Angular2通信
angular
、
components
、
angular2-injection
、
angular2-inputs
我使用Angular2搜索组件之间的通信,我在此模式下尝试过,但不起作用。 此模板的variantpages.component.html内容 <button (click)="changetext()">Change</button> <child></child> @Component({ selector: 'menu-left', templateUrl: './app/pages/variantpages.component.html' }) export class A
浏览 6
提问于2017-04-10
得票数 0
2
回答
Angular2表单字段不切换@输入变量
typescript
、
angular
在Angular2中,我有一个非常简单的形式: Form.ts import {Component, Input} from 'angular2/core' @Component({ selector: 'my-form', providers: [], template: ` <form> {{ details }} <input type="text" placeholder="name" /> <input *ngIf="de
浏览 5
提问于2016-03-25
得票数 2
回答已采纳
1
回答
Angular 9:如何从templateRef访问子组件实例
angular
、
angular9
在angular 8中,我能够从templateRef访问子组件,如下所示: <ng-template #templateName> <child-component></child-component> </ng-template> @ViewChild('templateName') template; const childComponent = template._projectedViews[0].nodes[1].instance; 但是在将应用程序迁移到版本9之后,一切都发生了变化。现在,我在样板中没有投
浏览 5
提问于2021-11-01
得票数 1
2
回答
将更改数组传递给子组件@输入字段
javascript
、
angular
我试图将数组传递给子组件。数组是在父组件的onInit生命周期钩子的订阅方法中定义的。 父组件: import { Component, OnInit } from '@angular/core'; @Component({ selector: 'selector-parent', templateUrl: 'parent.component.html' }) export class ParentComponent implements OnInit { array: []; constructor() { } n
浏览 0
提问于2018-09-10
得票数 0
回答已采纳
2
回答
重置angular 2主元件和辅元件上的所有输入
angular
我是个角度2的新手。在学习Angular 2之后,我制作了一个使用父组件和子组件的演示应用程序。父组件的视图有表单元素和一些输入,子组件的视图有其他的输入。这是我对父组件的看法 <form #f="ngForm" (ngSubmit)="onSubmit(f)"><div class="field clearfix w50" > <label>Destination <span class="note">*</span></l
浏览 0
提问于2016-12-15
得票数 1
1
回答
Angular2 -检测组件子变量更改
angular
、
components
、
code-injection
父组件 import { Component, OnChange } from '@angular/core'; import { ChildComponent } from '../../reusable/user-offers/user-offers.component'; @Component({ ... directives: [ ChildComponent ] }) export class ParentComponent implements OnChange { @ViewChild(ChildComponent) priva
浏览 0
提问于2016-07-14
得票数 1
1
回答
将formArray传递给子组件时的角响应形状获取误差
angular
、
angular-reactive-forms
、
angular-forms
我有一个嵌套的反应性表单,其中包含formGroup和formArray。 当我试图将嵌套的formArray传递给子组件时,我得到的错误如下 FormArrayName必须与父formGroup指令一起使用。 下面是父窗体组 this.employeeForm= this.fb.group({ employee: this.fb.group({ name: [null], id: [null] }), address: this.fb.array({ location: [null], city: [null] }); }); 父窗体组件 <f
浏览 4
提问于2018-11-13
得票数 3
3
回答
无法在角2中将响应对象从一个组件传递到另一个组件
angular
、
typescript
import { Component, Input, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { FetchService } from '../fetch. Service'; @Component({ selector: 'app-first', templateUrl: './first.component.html', styleUrls: ['./first.com
浏览 6
提问于2021-05-10
得票数 1
回答已采纳
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Angular更改检测终极指南
我用Vue和React构建了相同的应用程序,这是它们的差别
MVVM双向绑定全量版整理
javascript 观察者模式应用
Vue 超快速学习
热门
标签
更多标签
云服务器
ICP备案
实时音视频
即时通信 IM
对象存储
活动推荐
运营活动
广告
关闭
领券