Skip to content

Instantly share code, notes, and snippets.

@alexzuza
Created October 14, 2017 18:45
Show Gist options
  • Save alexzuza/facf42995014f7498b8389c9b931dcec to your computer and use it in GitHub Desktop.
Save alexzuza/facf42995014f7498b8389c9b931dcec to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';
@Component({
selector: 'address',
template: `
<fieldset ngModelGroup="address">
<div>
<label>Zip:</label>
<input type="text" name="zip" ngModel>
</div>
<div>
<label>Street:</label>
<input type="text" name="street" ngModel>
</div>
<div>
<label>City:</label>
<input type="text" name="city" ngModel>
</div>
</fieldset>
`,
viewProviders: [ { provide: ControlContainer, useExisting: NgForm } ]
})
export class AddressComponent {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment