我在表格字段中使用Angula(4)+ Angular Material和Reactive Forms.我怎么能禁用它?我试过谷歌,但像残疾人="真"或类似的东西.你能告诉我正确的语法吗?这一定很容易.谢谢!
我的例子:
<mat-form-field class="xxx-form-full-with">
<textarea matInput placeholder="My description" formControlName="xxx"></textarea>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud) 我对 Angular 6 有以下错误
<mat-tab-group [(selectedIndex)]="selectedTabIndex">
<mat-tab label="Add">
<ng-template matTabContent>
<form [formGroup]="entityAddFormGroup">
<dynamic-material-form [group]="entityAddFormGroup" [model]="entityAddFormCtlModelArray"></dynamic-material-form>
<button (click)="buttonAddEntityClicked(entityAddFormGroup.value)">Add</button>
</form>
</ng-template>
</mat-tab>
<mat-tab *ngIf="entityEditFormGroup && currentEntity" label="Edit #{{currentEntity.id}}">
<!-- TODO correct bug with -->
<ng-template matTabContent>
<form [formGroup]="entityEditFormGroup">
<!-- <h2 i18n>Edit #{{currentEntity.id}}</h2> -->
<dynamic-material-form [group]="entityEditFormGroup" [model]="entityEditFormCtlModelArray"></dynamic-material-form>
<button (click)="buttonEditEntityClicked(entityEditFormGroup.value)">Save</button>
</form>
</ng-template>
</mat-tab>
</mat-tab-group>
Run Code Online (Sandbox Code Playgroud)
当我删除第二个mat-tab错误消失
进入其他类似的组件,我没有把这2个表格放到一个mat-tab-groupand里mat-tab,也没有这个错误。
花了一段时间发现差异在哪里。
ExpressionChangedAfterItHasBeenCheckedError:检查后表达式已更改。以前的值:'ng-valid:true'。当前值:'ng-valid:false'。
Angular CLI: 6.2.8
Node: 11.9.0
OS: linux x64
Angular:
Run Code Online (Sandbox Code Playgroud)
public displayedColumnsArray = …Run Code Online (Sandbox Code Playgroud) 当我在做一个编辑(vi)时,git commit -m我想让一个编辑做
git tag myTagName -m
因为我的评论将包含带引号的代码,我想避免转义它!
将corsfilter添加到ApplicationPath后,我无法访问任何服务
这是一个例子
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import org.jboss.resteasy.plugins.interceptors.CorsFilter;
@ApplicationPath("/")
public class JaxRsActivator extends Application {
private Set<Object> singletons = new HashSet<Object>();
private Set<Class<?>> classes = new HashSet<Class<?>>();
public JaxRsActivator() {
CorsFilter corsFilter = new CorsFilter();
corsFilter.getAllowedOrigins().add("*");
corsFilter.setAllowedHeaders("Content-Type");
singletons.add(corsFilter);
}
@Override
public Set<Class<?>> getClasses() {
return classes;
}
@Override
public Set<Object> getSingletons() {
return singletons;
}
}
Run Code Online (Sandbox Code Playgroud)
如果我卷曲,我会得到这个,
curl -i http://localhost:8080/unika/usuarios -H "Origin:otherdomain.com"
HTTP/1.1 404 Not Found
Connection: keep-alive
Access-Control-Allow-Origin: otherdomain.com
X-Powered-By: Undertow 1
Server: Wildfly 8 …Run Code Online (Sandbox Code Playgroud)