ngForm (directive)

Improve this Doc View Source ngForm

  1. directive in module ng

Nestable alias of form directive- HTML does not allow nesting of form elements- It is useful to nest forms, for example if the validity of a sub-group of controls needs to be determined-

Note: the purpose of ngForm is to group controls, but not to be a replacement for the <form> tag with all of its capabilities (e-g- posting to the server, ---)-

Directive Info

  • This directive executes at priority level 0-

Usage

  • as element: (This directive can be used as custom element, but be aware of IE restrictions).
    <ng-form
      [name="string"]>
    ...
    </ng-form>
  • as attribute:
    <ANY
      [ng-form="string"]>
    ...
    </ANY>
  • as CSS class:
    <ANY class="[ng-form: string;]"> ... </ANY>

Arguments

Param Type Details
ngForm | name
(optional)
string

Name of the form. If specified, the form controller will be published into related scope, under this name.

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.6.4/docs/api/ng/directive/ngForm

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部