上一页 1 ··· 448 449 450 451 452 453 454 455 456 ··· 491 下一页
摘要: Create a custom validtor which only accepts the string start with '123'; function skuValidator(control){ if(!control.value.match(/^123/)){ ... 阅读全文
posted @ 2015-11-09 01:48 Zhentiw 阅读(423) 评论(0) 推荐(0)
摘要: In last post, we need to create an instanse variable:sku: AbstructControl;We can get rid of this by getting the exported form from NgFormControl, what... 阅读全文
posted @ 2015-11-09 01:37 Zhentiw 阅读(355) 评论(0) 推荐(0)
摘要: Define a filed should has validation: export class DemoFormSku { myForm: ControlGroup; sku: AbstractControl; constructor(fb:FormBuilder) { this.myForm 阅读全文
posted @ 2015-11-06 04:04 Zhentiw 阅读(622) 评论(0) 推荐(0)
摘要: There are two main functions we’ll use on FormBuilder:•control - creates a new Control• group - creates a new ControlGroupimport {Component, bootstrap... 阅读全文
posted @ 2015-11-06 02:55 Zhentiw 阅读(618) 评论(0) 推荐(0)
摘要: Control:Controls encapsulate the field's value, a states such as if it is valid, dirty or has errors.var nameControl = new Control("Nate");var name = ... 阅读全文
posted @ 2015-11-06 02:40 Zhentiw 阅读(466) 评论(0) 推荐(0)
摘要: If you want to print someting like {{content}} on the html, using ng-non-bindable directive: 阅读全文
posted @ 2015-11-06 02:10 Zhentiw 阅读(379) 评论(0) 推荐(0)
摘要: Optional ArgumentsSet default arguments, when we don't need to call it, we can simply skip it.def new_game(name, year=nil, system=nil) { name: nam... 阅读全文
posted @ 2015-11-02 02:52 Zhentiw 阅读(225) 评论(0) 推荐(0)
摘要: 1. Rails commends line:Example:rails new blog --skip-test-unit --database=postgresql 阅读全文
posted @ 2015-11-02 02:51 Zhentiw 阅读(201) 评论(0) 推荐(0)
摘要: Nowdays, Single page apps are becoming increasingly popularamong the fornt-end developers. It is the time to say goodbye with refreshing the whole pag... 阅读全文
posted @ 2015-11-02 02:50 Zhentiw 阅读(484) 评论(0) 推荐(0)
摘要: To Currencyfunction toCurrency(price){ return price.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");}Deletion from Array:function deleteValues(a... 阅读全文
posted @ 2015-11-02 02:48 Zhentiw 阅读(329) 评论(0) 推荐(0)
上一页 1 ··· 448 449 450 451 452 453 454 455 456 ··· 491 下一页