Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active February 4, 2017 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/7867bbe5eb35e4b1a8f60c62dddc42c8 to your computer and use it in GitHub Desktop.
Save matthieu-D/7867bbe5eb35e4b1a8f60c62dddc42c8 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { User } from '../user/user.d';
@Component({
selector: 'my-home',
templateUrl: './home.component.html'
})
export class HomeComponent {
user: User = {
name: '',
email: '',
address: {
country: '',
city: ''
}
};
onFormSubmitted(userForm) {
console.log('Model returned for user:', this.user);
console.log('Form data returned for user:', userForm.value);
// Rest of the logic here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment