Rename model attributes to remove underscore

master
Kevin C. Coram 2019-09-08 18:49:36 -04:00
parent 00577f888e
commit a6d883f68e
Signed by: kevin
GPG Key ID: 0342351B3D61AD35
5 changed files with 12 additions and 12 deletions

View File

@ -51,8 +51,8 @@ export class AppComponent implements OnInit, OnDestroy {
model.addresses.forEach(addr => { model.addresses.forEach(addr => {
addresses.push( addresses.push(
this.fb.group({ this.fb.group({
line1: [addr ? addr.line_1 : ''], line1: [addr ? addr.line1 : ''],
line2: [addr ? addr.line_2 : ''], line2: [addr ? addr.line2 : ''],
city: [addr ? addr.city : ''], city: [addr ? addr.city : ''],
state: [addr ? addr.state : ''], state: [addr ? addr.state : ''],
postalCode: [addr ? addr.postalCode : ''], postalCode: [addr ? addr.postalCode : ''],

View File

@ -18,8 +18,8 @@ export class AddressComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.group = this.fb.group({ this.group = this.fb.group({
line1: [this.address ? this.address.line_1 : ''], line1: [this.address ? this.address.line1 : ''],
line2: [this.address ? this.address.line_2 : ''], line2: [this.address ? this.address.line2 : ''],
city: [this.address ? this.address.city : ''], city: [this.address ? this.address.city : ''],
state: [this.address ? this.address.state : ''], state: [this.address ? this.address.state : ''],
postalCode : [this.address ? this.address.postalCode : ''], postalCode : [this.address ? this.address.postalCode : ''],

View File

@ -7,8 +7,8 @@ export interface Name {
} }
export interface Address { export interface Address {
line_1: string; line1: string;
line_2: string; line2: string;
city: string; city: string;
state: string; state: string;
postalCode: string; postalCode: string;

View File

@ -28,8 +28,8 @@ export class ContactFormService {
model.addresses.forEach(addr => { model.addresses.forEach(addr => {
addresses.push( addresses.push(
this.fb.group({ this.fb.group({
line1: [addr ? addr.line_1 : ''], line1: [addr ? addr.line1 : ''],
line2: [addr ? addr.line_2 : ''], line2: [addr ? addr.line2 : ''],
city: [addr ? addr.city : ''], city: [addr ? addr.city : ''],
state: [addr ? addr.state : ''], state: [addr ? addr.state : ''],
postalCode: [addr ? addr.postalCode : ''], postalCode: [addr ? addr.postalCode : ''],

View File

@ -13,15 +13,15 @@ const contact: Contact = {
}, },
addresses: [ addresses: [
{ {
line_1: '123 Main Street', line1: '123 Main Street',
line_2: null, line2: null,
city: 'New York', city: 'New York',
state: 'NY', state: 'NY',
postalCode: '12345', postalCode: '12345',
}, },
{ {
line_1: '123 South Street', line1: '123 South Street',
line_2: null, line2: null,
city: 'Boston', city: 'Boston',
state: 'MA', state: 'MA',
postalCode: '54321', postalCode: '54321',