Rename model attributes to remove underscore
parent
00577f888e
commit
a6d883f68e
|
@ -51,8 +51,8 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
model.addresses.forEach(addr => {
|
||||
addresses.push(
|
||||
this.fb.group({
|
||||
line1: [addr ? addr.line_1 : ''],
|
||||
line2: [addr ? addr.line_2 : ''],
|
||||
line1: [addr ? addr.line1 : ''],
|
||||
line2: [addr ? addr.line2 : ''],
|
||||
city: [addr ? addr.city : ''],
|
||||
state: [addr ? addr.state : ''],
|
||||
postalCode: [addr ? addr.postalCode : ''],
|
||||
|
|
|
@ -18,8 +18,8 @@ export class AddressComponent implements OnInit {
|
|||
|
||||
ngOnInit() {
|
||||
this.group = this.fb.group({
|
||||
line1: [this.address ? this.address.line_1 : ''],
|
||||
line2: [this.address ? this.address.line_2 : ''],
|
||||
line1: [this.address ? this.address.line1 : ''],
|
||||
line2: [this.address ? this.address.line2 : ''],
|
||||
city: [this.address ? this.address.city : ''],
|
||||
state: [this.address ? this.address.state : ''],
|
||||
postalCode : [this.address ? this.address.postalCode : ''],
|
||||
|
|
|
@ -7,8 +7,8 @@ export interface Name {
|
|||
}
|
||||
|
||||
export interface Address {
|
||||
line_1: string;
|
||||
line_2: string;
|
||||
line1: string;
|
||||
line2: string;
|
||||
city: string;
|
||||
state: string;
|
||||
postalCode: string;
|
||||
|
|
|
@ -28,8 +28,8 @@ export class ContactFormService {
|
|||
model.addresses.forEach(addr => {
|
||||
addresses.push(
|
||||
this.fb.group({
|
||||
line1: [addr ? addr.line_1 : ''],
|
||||
line2: [addr ? addr.line_2 : ''],
|
||||
line1: [addr ? addr.line1 : ''],
|
||||
line2: [addr ? addr.line2 : ''],
|
||||
city: [addr ? addr.city : ''],
|
||||
state: [addr ? addr.state : ''],
|
||||
postalCode: [addr ? addr.postalCode : ''],
|
||||
|
|
|
@ -13,15 +13,15 @@ const contact: Contact = {
|
|||
},
|
||||
addresses: [
|
||||
{
|
||||
line_1: '123 Main Street',
|
||||
line_2: null,
|
||||
line1: '123 Main Street',
|
||||
line2: null,
|
||||
city: 'New York',
|
||||
state: 'NY',
|
||||
postalCode: '12345',
|
||||
},
|
||||
{
|
||||
line_1: '123 South Street',
|
||||
line_2: null,
|
||||
line1: '123 South Street',
|
||||
line2: null,
|
||||
city: 'Boston',
|
||||
state: 'MA',
|
||||
postalCode: '54321',
|
||||
|
|
Loading…
Reference in New Issue