Skip to content

Commit

Permalink
#44 Review iteration 1
Browse files Browse the repository at this point in the history
  • Loading branch information
natlex-to-me committed Mar 16, 2021
1 parent 6299cb8 commit 43fab20
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { ModalModule } from 'src/app/modal';

import { MapsModule } from './main/maps.module';
import { MatButtonModule } from '@angular/material/button';
import { MatNativeDateModule } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatIconModule } from '@angular/material/icon';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
Expand All @@ -32,12 +30,10 @@ import { GoogleMapsConfigModule } from 'src/app/google-maps';
BrowserAnimationsModule,
MapsModule,
MatButtonModule,
MatDatepickerModule,
MatIconModule,
MatFormFieldModule,
MatInputModule,
MatMenuModule,
MatNativeDateModule,
ModalModule,
GoogleMapsConfigModule.forRoot(environment.googleMapApiKey),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<google-map
class="map"
height="100%"
(mapClick)="openMarkerModal($event)"
(mapClick)="addMarker($event)"
[options]="options"
width="100%"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class GoogleMapComponent {
private readonly _modal: ModalService
) {}

openMarkerModal(evnt: google.maps.MouseEvent) {
addMarker(evnt: google.maps.MouseEvent) {
const newMarker = <Marker>{
coordinates: {
latitude: evnt.latLng.lat(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ import {
ViewChild,
} from '@angular/core';
import { NgForm } from '@angular/forms';
import { MAT_DATE_FORMATS } from '@angular/material/core';
import { MatDatepicker } from '@angular/material/datepicker';
import {
DateAdapter,
MAT_DATE_FORMATS,
NativeDateAdapter,
} from '@angular/material/core';
import {
MAT_DATEPICKER_SCROLL_STRATEGY,
MatDatepicker,
} from '@angular/material/datepicker';
import { tap } from 'rxjs/operators';
import { YEAR_MODE } from 'src/app/main/constants';
import { Marker } from 'src/app/main/models';
Expand All @@ -23,6 +30,14 @@ import { ModalComponentConfig } from 'src/app/modal/models';
provide: MAT_DATE_FORMATS,
useValue: YEAR_MODE,
},
{
provide: DateAdapter,
useClass: NativeDateAdapter,
},
{
provide: MAT_DATEPICKER_SCROLL_STRATEGY,
useValue: () => {},
},
],
})
export class MarkerDialogComponent implements ModalComponentConfig<Marker> {
Expand Down

0 comments on commit 43fab20

Please sign in to comment.