mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 15:40:11 +01:00
refactor: remove unnecessary access modifiers
This commit is contained in:
parent
3208c43a79
commit
d5ebe5ad4c
5 changed files with 16 additions and 17 deletions
|
|
@ -6,5 +6,5 @@ import { Component } from '@angular/core';
|
|||
templateUrl: './gmaps.component.html',
|
||||
})
|
||||
export class GmapsComponent {
|
||||
public readonly position = { lat: 51.678418, lng: 7.809007 };
|
||||
readonly position = { lat: 51.678418, lng: 7.809007 };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export class PositionModel {
|
||||
public constructor(
|
||||
public lat: number = 53.9,
|
||||
public lng: number = 27.5667,
|
||||
constructor(
|
||||
public lat = 53.9,
|
||||
public lng = 27.5667,
|
||||
) {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,19 +7,18 @@ import { PositionModel } from '../entity/position.model';
|
|||
styleUrls: ['./map.component.scss'],
|
||||
})
|
||||
export class MapComponent implements OnInit {
|
||||
public position: PositionModel = null;
|
||||
public zoom: number = 1;
|
||||
position: PositionModel = null;
|
||||
zoom: number = 1;
|
||||
|
||||
@Input()
|
||||
public set searchedPosition(position: PositionModel) {
|
||||
if (!position) return;
|
||||
|
||||
console.dir(position);
|
||||
this.position = position;
|
||||
this.zoom = 12;
|
||||
if (position) {
|
||||
this.position = position;
|
||||
this.zoom = 12;
|
||||
}
|
||||
}
|
||||
|
||||
public ngOnInit(): void {
|
||||
ngOnInit() {
|
||||
// set up current location
|
||||
if ('geolocation' in navigator) {
|
||||
navigator.geolocation.getCurrentPosition((position) => {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import { PositionModel } from './entity/position.model';
|
|||
templateUrl: './search-map.component.html',
|
||||
})
|
||||
export class SearchMapComponent {
|
||||
public searchedPosition: PositionModel = new PositionModel();
|
||||
searchedPosition: PositionModel = new PositionModel();
|
||||
|
||||
public setPosition(position: PositionModel): void {
|
||||
setPosition(position: PositionModel) {
|
||||
this.searchedPosition = position;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ import { PositionModel } from '../entity/position.model';
|
|||
export class SearchComponent implements OnInit {
|
||||
|
||||
@Output()
|
||||
public readonly positionChanged: EventEmitter<PositionModel> = new EventEmitter<PositionModel>();
|
||||
positionChanged: EventEmitter<PositionModel> = new EventEmitter<PositionModel>();
|
||||
|
||||
@ViewChild('search', { static: true })
|
||||
public searchElementRef: ElementRef;
|
||||
searchElementRef: ElementRef;
|
||||
|
||||
constructor(private readonly ngZone: NgZone) {}
|
||||
constructor(private ngZone: NgZone) {}
|
||||
|
||||
ngOnInit() {
|
||||
const autocomplete = new google.maps.places.Autocomplete(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue