Skip to content

Commit

Permalink
fix(project): bug fixed with validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed Jun 2, 2022
1 parent 5ddffb2 commit 5fed9db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component, OnInit} from '@angular/core';
import {Appearance, GermanAddress, Location} from '@angular-material-extensions/google-maps-autocomplete';
import {Angulartics2GoogleAnalytics} from 'angulartics2/ga';
import {UntypedFormControl, UntypedFormGroup} from '@angular/forms';
import {UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
import PlaceResult = google.maps.places.PlaceResult;

@Component({
Expand All @@ -13,7 +13,7 @@ export class AppComponent implements OnInit {

title = 'google-maps-autocomplete';

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

public appearance = Appearance;
Expand Down Expand Up @@ -72,10 +72,10 @@ export class AppComponent implements OnInit {
// address: new FormControl(),
});

this.addressFormGroup
.get('address')
.valueChanges
.subscribe(value => console.log('value changed', value))
// this.addressFormGroup
// .get('address')
// .valueChanges
// .subscribe(value => console.log('value changed', value))

this.addressFC
.valueChanges
Expand Down
3 changes: 1 addition & 2 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

export const environment = {
production: false,
// GOOGLE_MAPS_API_KEY: 'AIzaSyBo7c5QYv-RWE1bgrtngHzQju_8lKBlIxs'
GOOGLE_MAPS_API_KEY: 'AIzaSyD7FfGhQ3h8Q54zWzYl95R-FByAz-GAfLk'
GOOGLE_MAPS_API_KEY: ''
};

/*
Expand Down

0 comments on commit 5fed9db

Please sign in to comment.