Skip to content

Commit 5fed9db

Browse files
committed
fix(project): bug fixed with validation
1 parent 5ddffb2 commit 5fed9db

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/app/app.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Component, OnInit} from '@angular/core';
22
import {Appearance, GermanAddress, Location} from '@angular-material-extensions/google-maps-autocomplete';
33
import {Angulartics2GoogleAnalytics} from 'angulartics2/ga';
4-
import {UntypedFormControl, UntypedFormGroup} from '@angular/forms';
4+
import {UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
55
import PlaceResult = google.maps.places.PlaceResult;
66

77
@Component({
@@ -13,7 +13,7 @@ export class AppComponent implements OnInit {
1313

1414
title = 'google-maps-autocomplete';
1515

16-
addressFC: UntypedFormControl = new UntypedFormControl('Zollstock 34');
16+
addressFC: UntypedFormControl = new UntypedFormControl(null, [Validators.required]);
1717
addressFormGroup: UntypedFormGroup;
1818

1919
public appearance = Appearance;
@@ -72,10 +72,10 @@ export class AppComponent implements OnInit {
7272
// address: new FormControl(),
7373
});
7474

75-
this.addressFormGroup
76-
.get('address')
77-
.valueChanges
78-
.subscribe(value => console.log('value changed', value))
75+
// this.addressFormGroup
76+
// .get('address')
77+
// .valueChanges
78+
// .subscribe(value => console.log('value changed', value))
7979

8080
this.addressFC
8181
.valueChanges

src/environments/environment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
export const environment = {
66
production: false,
7-
// GOOGLE_MAPS_API_KEY: 'AIzaSyBo7c5QYv-RWE1bgrtngHzQju_8lKBlIxs'
8-
GOOGLE_MAPS_API_KEY: 'AIzaSyD7FfGhQ3h8Q54zWzYl95R-FByAz-GAfLk'
7+
GOOGLE_MAPS_API_KEY: ''
98
};
109

1110
/*

0 commit comments

Comments
 (0)