angular 2.0 forms

angular 2.0 forms

ID:40356828

大小:155.92 KB

页数:17页

时间:2019-07-31

angular 2.0 forms_第1页
angular 2.0 forms_第2页
angular 2.0 forms_第3页
angular 2.0 forms_第4页
angular 2.0 forms_第5页
资源描述:

《angular 2.0 forms》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、Angular2.0:FormsThis document is published to the web as part of the public Angular Design Docs folderObjectiveAngular 1.x uses twoway data bindings to get data from the DOM. This can create cycles in the change detection graph, which results in the following proble

2、ms:●It is difficult to reason about the data flow in the application and understand which components can affect which values.●The framework has to run digest multiple times, which is not performant.●Because of multiple digests, it is impossible to determine and noti

3、fy the component that the model is stable. This is because notification can further change data, which can restart the binding process.●The framework cannot set all the bindings on a parent element before processing its children, which makes implementing certain pat

4、terns very difficult.●The framework is harder to learn. The developer has to think about the digest cycle. ●Since the order of updates is not well defined, troubleshooting certain types of problems is challenging.Instead of a generic mechanism for twoway data bindin

5、gs, Angular 2 can have a more constrained API for getting data from the DOM as a remedy for these issues.ProposedDesign●FormControl, FormControlGroup, FormControlArray are three basic primitives for constructing forms. ●FormBuilder provides a DSL making form declara

6、tion more concise. FormBuilder creates FormControl, FormControlGroup, FormControlArray. ●Forms can be declared in the template of a component. This creates FormControl, FormControlGroup, FormControlArray.Even though most developers will use FormBuilder or will decla

7、re their forms in the template, most examples in the document use FormControl, FormControlGroup, FormControlArray directly. This is to make the examples more explicit.SimpleFormsclassSomeComponent{constructor(){<

8、inputcontrol='password'type="password">this.loginForm=newFormControlGroup("form",[newFormControl("login"),newFormControl("password"

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。