• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript forms.FormBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中angular2/forms.FormBuilder的典型用法代码示例。如果您正苦于以下问题:TypeScript FormBuilder类的具体用法?TypeScript FormBuilder怎么用?TypeScript FormBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了FormBuilder类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor(protected formBuilder: FormBuilder,
   protected userService: UserDataService) {
   this.form = this.formBuilder.group({
     name: ['', Validators.required],
     email: ['', Validators.required]
   });
 }
开发者ID:Brocco,项目名称:ng2-play,代码行数:7,代码来源:edit-user.ts


示例2: constructor

	constructor(b: FormBuilder, contracts: Contracts){
		this.exContr = new ExContr();
		
		this.exContr.contract = 'zcb';
		this.exContr.arg1 = 3.0;
		this.exContr.arg2 = 10;
		this.exContr.image = true;
		
		this.contractJson = "{}"
		this.latticeImage = ""
		this.expectedValueChart = ""

		this.builder = b;
		this.contracts = contracts;
		
		this.exContrForm = this.builder.group({
			contract: [this.exContr.contract],
			arg1: [this.exContr.arg1],
			arg2: [this.exContr.arg2],
			image: [this.exContr.image],
		});
		
		
		
		// this.exContrForm.valueChanges.forEach( ()=> this.exContrForm.writeTo(this.exContr));
	}
开发者ID:yuriylesyuk,项目名称:scala-contracts-client,代码行数:26,代码来源:contracts.ts


示例3: constructor

 constructor(builder: FormBuilder) {
   this.form = builder.group({
     fullName: ["", Validators.required],
     username: ["", Validators.required],
     favColor: [""]
   });
 }
开发者ID:evertonrobertoauler,项目名称:babel-angular2-app,代码行数:7,代码来源:form.ts


示例4: constructor

 constructor(builder: FormBuilder, private resortsEP: ResortsEP) {
   this.createResortForm = builder.group({
     name: ["", Validators.required]
   });
   
   this.created = new EventEmitter();    
 }
开发者ID:data-avail,项目名称:rb-index,代码行数:7,代码来源:resort-create-form.ts


示例5: constructor

    constructor(builder:FormBuilder) {
        // this.builder = FormBuilder;
        this.contactForm = builder.group({
            name: ["", Validators.required]
        });

        console.log(this.contactForm);
    }
开发者ID:ludohenin,项目名称:angular2-demo-app,代码行数:8,代码来源:contact-form.ts


示例6: constructor

	constructor(public formBuilder: FormBuilder){
		this.loginForm = formBuilder.group({
			'login': ['', Validators.required],
			'password':['']
		})

		this.loginUsername = this.loginForm.controls.login;
		this.loginPassword = this.loginForm.controls.password;
//this.loginUsername = this.loginForm.controls.loginUsername;
}
开发者ID:JamesUlph,项目名称:angular2-webpack-starterOLD,代码行数:10,代码来源:login.ts


示例7: constructor

  constructor(
    public formBuilder: FormBuilder,
    public todoService: TodoService) {

    this.todoForm = formBuilder.group({
      'todo': ['', Validators.required]
    });
    this.todoInput = this.todoForm.controls.todo;

  }
开发者ID:oneredorange,项目名称:angular2-webpack-starter,代码行数:10,代码来源:todo.ts


示例8: constructor

	constructor(partiesService: PartiesService, fb: FormBuilder) {
		this.partiesService = partiesService;
		this.parties = this.partiesService.parties;
		this.party = fb.group(
			{
				title: ['', Validators.required],
				description: ['', Validators.required]
			}
		)
	}
开发者ID:ibhi,项目名称:angular2-parties-app,代码行数:10,代码来源:app.ts


示例9: constructor

  constructor(public router:Router,
              public formBuilder:FormBuilder,
              public http:Http) {

    this.loginForm = this.formBuilder.group({
      'email': ['', Validators.required],
      'password': ['', Validators.required]
    });

    this.emailInput = this.loginForm.controls.email;
    this.passwordInput = this.loginForm.controls.password;

  }
开发者ID:thomasschulze,项目名称:fooddiary-angular2,代码行数:13,代码来源:login.ts


示例10: constructor

    constructor(public router:Router, public bookService:BookService, public formBuilder: FormBuilder) {
        this.book = new Book();
        this.createFailedMsg = null;
        this.canShowCreateFailedMsg = false;

        this.createBookForm = formBuilder.group({
            'isbn': ['', Validators.required],
            'title': ['', Validators.required],
            'author': [''],
            'publicationDate': ['']
        });

        this.isbnInput = this.createBookForm.controls.isbn;
        this.titleInput = this.createBookForm.controls.title;
        this.authorInput = this.createBookForm.controls.author;
        this.publicationDateInput = this.createBookForm.controls.publicationDate;
    }
开发者ID:elf-mouse,项目名称:ts.ng,代码行数:17,代码来源:create-book.ts



注:本文中的angular2/forms.FormBuilder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript forms.Validators类代码示例发布时间:2022-05-25
下一篇:
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap