
p.location-badge.
  exported from <a href='../core'>angular2/core</a>
  defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/ng_control_group.ts#L13-L76">angular2/src/core/forms/directives/ng_control_group.ts (line 13)</a>

:markdown
  Creates and binds a control group to a DOM element.
  
  This directive can only be used as a child of <a href='NgForm-class.html'><code>NgForm</code></a> or <a href='NgFormModel-class.html'><code>NgFormModel</code></a>.
  
  # Example
  
  In this example, we create the credentials and personal control groups.
  We can work with each group separately: check its validity, get its value, listen to its changes.
  
   ```
  @Component({selector: "signup-comp"})
  @View({
       directives: [FORM_DIRECTIVES],
       template: `
               <form #f="form" (submit)='onSignUp(f.value)'>
                 <div ng-control-group='credentials' #credentials="form">
                   Login <input type='text' ng-control='login'>
                   Password <input type='password' ng-control='password'>
                 </div>
                 <div *ng-if="!credentials.valid">Credentials are invalid</div>
  
                 <div ng-control-group='personal'>
                   Name <input type='text' ng-control='name'>
                 </div>
                 <button type='submit'>Sign Up!</button>
               </form>
       `})
  class SignupComp {
   onSignUp(value) {
     // value === {
     //  personal: {name: 'some name'},
     //  credentials: {login: 'some login', password: 'some password'}}
   }
  }
  
   ```
  
  

.l-main-section
  h2 Annotations
  .l-sub-section
    h3.annotation Directive
    pre.prettyprint
      code.
        @Directive({
          selector: &#39;[ng-control-group]&#39;,
          bindings: [controlGroupBinding],
          properties: [&#39;name: ng-control-group&#39;],
          exportAs: &#39;form&#39;
        })


.l-main-section
  h2 Members
  .l-sub-section
    h3#constructor constructor

    
    pre.prettyprint
      code.
        constructor(_parent: ControlContainer)
    
    :markdown




  .l-sub-section
    h3#onInit onInit

    
    pre.prettyprint
      code.
        onInit()
    
    :markdown





  .l-sub-section
    h3#onDestroy onDestroy

    
    pre.prettyprint
      code.
        onDestroy()
    
    :markdown





  .l-sub-section
    h3#control control

    
    :markdown





  .l-sub-section
    h3#path path

    
    :markdown





  .l-sub-section
    h3#formDirective formDirective

    
    :markdown




