Some useful code snippets for Angular.io
private coordinatesValidator(option: string) {
return (control: FormControl): { [key: string]: any } | null => {
const value: string = control.value;
const regex =
option === 'lat'
? /^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$/
: /^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$/;
const parsedValue = !regex.test(value);
return parsedValue
? { invalidCoordinates: { coordinates: value } }
: null;
};
}
Examples of the dev Dockerfile and docker-compose for the development environment. It assumes that your Dockerfile and docker-compose located at the same directory as the app root.
docker-compose up --build -d --force-recreate
docker ps -a
or docker container ls -a
Show list of all containers (-a). You can skip -a option to show only running.
docker images -a
Show list of all (-a) images
Remove all unused images:
docker image prune -a -f
Removes all (-a) unused images without confirmation (-f)
Remove all stopped containers:
docker container prune -f
Launch interactive terminal:
docker exec -it 466a13554655 /bin/sh
Exit interactive terminal:
exit