我正在向父组件表单添加子组件.
<form [formGroup]="usuarioForm" novalidate>
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputNome">Nome</label>
<input type="text"
formControlName="nome"
class="form-control "
placeholder="Nome" />
</div>
</div>
<endereco [enderecoGroup]=usuarioForm></endereco>
<button type="submit"
class="btn btn-default"
(click)="InsereUsuario(usuarioForm.value)">
Enviar
</button>
</form>
Run Code Online (Sandbox Code Playgroud)
<h4>Endereço</h4>
<div class="col-md-2">
<div class="form-group" [formGroup]="enderecoGroup">
<label for="exampleInputCep">Cep</label>
<input type="text"
class="form-control"
placeholder="Cep"
(blur)="GetAdress($event.target.value)">
</div>
</div>
<div class="col-md-4">
<div class="form-group" [formGroup]="enderecoGroup">
<label for="exampleInputComplemento">Complemento</label>
<input type="text"
class="form-control"
placeholder="Complemento"
[value]=endereco?.complemento>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
@Input() enderecoGroup: FormGroup;
endereco: Endereco
GetEndereco(Cep: string) {
this.servico.GetEndereco(Cep)
.subscribe(resposta => this.endereco = resposta);
}
Run Code Online (Sandbox Code Playgroud)
提交表单时,Adress.html条目为空白,我该怎么办?
我正在使用React表单
我的测试没有检测到变化.这是我的组件:
toggleUploadModal() {
const modalRef = this.ngbModal.open(UploadFilesComponent, { size: 'lg', backdrop: 'static' });
modalRef.componentInstance.DeliverableTransaction = this.transactionDetails;
modalRef.result.then((res) => {
if (res.status === 'success') {
this.deliverableTransactionService.updateDeliverableTransaction(this.route.snapshot.params.id, {
submissionStatus: 'In Process'
})
}
setTimeout(() => {
this.uploadStatus = {};
}, 5000);
})
}
Run Code Online (Sandbox Code Playgroud)
我的测试有:
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [TransactionFileViewer, NgxPermissionsAllowStubDirective],
providers: [...],
imports: [...],
schemas: [
NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA
],
})
.compileComponents();
fixture = TestBed.createComponent(TransactionFileViewer);
downloadService = TestBed.get(DownloadService);
component = fixture.componentInstance;
fixture.detectChanges();
submissionFileService = TestBed.get(SubmissionFileService);
deliverableDefinitionService = TestBed.get(DeliverableDefinitionService);
service = TestBed.get(DeliverableDefinitionDetailViewService);
deliverableTransactionService …Run Code Online (Sandbox Code Playgroud) 我正在使用角 6 和角材料。我正在使用角材料的垫子步进器。想要更改默认、活动和访问步骤的垫子图标颜色。任何人都可以帮忙吗?
:host /deep/ mat-horizontal-stepper .mat-horizontal-stepper-header-container .mat-step-icon {
background-color: "red" !important;
color: #fff !important;
}
.mat-step-icon-selected,
.mat-step-icon-state-done,
.mat-step-icon-state-edit {
background-color: "blue";
color:#fff;
}
Run Code Online (Sandbox Code Playgroud)
也试过这个:
/deep/ mat-step-header.mat-horizontal-stepper-header > div.mat-step-icon-selected {
background-color:'red';
}
Run Code Online (Sandbox Code Playgroud)
但不工作
谢谢
我正在使用带有角度2的nativescript。
我想知道如何在Nativescript项目中快速创建ng组件。例如,在Angular 2中创建我们正在使用的组件ng generate component hello。
是否有针对此的nativescript CLI解决方案?
我最近在使用ng update
和运行时更新了我的angular版本ng lint
我收到错误 create is deprecated: use new Observable() instead
this.data$ = Observable.create(t => {
t.next(this.model);
t.complete();
});
Run Code Online (Sandbox Code Playgroud)
new observable的语法是什么?
当我尝试通过控制台从 AWS S3 下载一个文件时,出现以下错误:
此 XML 文件似乎没有任何与之关联的样式信息。
文档树如下所示。
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>DF19E559FDBA71C2</RequestId>
<HostId>f5cIaO8eh2yTmC+rtVIVg54xY4EXAjG6lsxzjbBjzMRwDWaMFaggAU3Wyoipy2ZuDHQLhz402DE=</HostId>
</Error>
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙解决这个问题。
提前致谢
当我尝试将样式与 p-menu 或 p-dropdown 一起使用时,出现错误“找不到不同的支持对象 'width: 100%'”。
有人请向我解释一下 Angular 6中的ng update与npm update之间的区别吗?
三周前我能够运行我的 python 程序,但现在每次我尝试运行它时,我都会收到以下错误:
AttributeError: module 'tensorflow' has no attribute 'placeholder'
Run Code Online (Sandbox Code Playgroud)
我安装了 tensorflow(版本“2.0.0-alpha0”)。我已经阅读了几篇与此问题相关的帖子。他们说我应该卸载 TensorFlow 并重新安装它。问题是我在集群计算机上运行它并且我没有sudo权限。
任何的想法?
我是 aws 的新手。我在存储桶中上传了一张图片
如果我尝试在浏览器中打开对象 url,则会出现以下错误。
下面是我配置我的存储桶的存储桶策略
{
"Version": "2012-10-17",
"Id": "Policy1566555268319",
"Statement": [
{
"Sid": "Stmt1566555264845",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::497899159094:user/DevUser"
},
"Action": [
"s3:PutObject",
"s3:PutObjectAcl"
],
"Resource": "arn:aws:s3:::akirainfocombucket/*",
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "public-read"
}
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
以下是 CORS 配置
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Run Code Online (Sandbox Code Playgroud)
根据支持团队的建议,将阻止所有公共访问设置为关闭。
我希望可以在浏览器中访问对象链接..(只读)
需要帮助配置存储桶?
angular ×7
amazon-s3 ×2
angular5 ×2
angular7 ×1
bluebird ×1
nativescript ×1
npm-update ×1
primeng ×1
spy ×1
stub ×1
tensorflow ×1