加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular2项目教程-微型Blog系统4

发布时间:2020-12-17 09:31:44 所属栏目:安全 来源:网络整理
导读:模板驱动型表单-登录 都写到模板 响应式表单-注册 一些移动到 页面form [formGroup]="userForm" 组件类 ngOnInit() { this.buildForm(); } buildForm(): void { this.userForm = this.fb.group({ "userName": [ ............. 动态表单-用户资料修改 user-pr
模板驱动型表单-登录
都写到模板
响应式表单-注册
一些移动到
页面<form [formGroup]="userForm"
组件类
ngOnInit() {
this.buildForm();
}

buildForm(): void {
this.userForm = this.fb.group({
"userName": [
.............

动态表单-用户资料修改
user-profile.component.ts中,代码生成
@Input() fields: FieldBase<any>[] = [
new Image({
src: "assets/imgs/angular2-small.png"
}),
new Textbox({
label: "头像:",
placeholder: "上传头像",
type: "file"
}),
.................
页面显示
<div *ngFor="let field of fields" class="form-group">
<form-control [form]="form" [field]="field"></form-control>
</div>
自定义校验规则指令
————————————————————————————————

——————————————————
国际化

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读