Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <mat-toolbar color="primary">
- <span>MAPS</span>
- </mat-toolbar>
- <div class="main-container">
- <mat-card>
- <div style="width: 100%">
- <div style="width: 500px;position: relative;">
- <iframe width="500" height="500" src="https://maps.google.com/maps?width=500&height=500&hl=en&q=18.22141715%2C%20-66.4132818505648+(Propiedades)&ie=UTF8&t=&z=8&iwloc=B&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe><div style="position: absolute;width: 80%;bottom: 10px;left: 0;right: 0;margin-left: auto;margin-right: auto;color: #000;text-align: center;"><small style="line-height: 1.8;font-size: 2px;background: #fff;">Powered by <a href="http://www.googlemapsgenerator.com/nl/">https://www.googlemapsgenerator.com/nl/</a> & <a href="http://lnk.direct/7Lf4">http://lnk.direct/7Lf4</a></small></div><style>#gmap_canvas img{max-width:none!important;background:none!important}</style></div><br />
- </div>
- <div>
- <form [formGroup]='forma' (ngSubmit)='buscar()' >
- <div class="form-group">
- <label for="nombre">Nombre</label>
- <input
- type="text"
- class="form-control"
- id="nombre"
- aria-describedby="emailHelp"
- placeholder="Enter email"
- formControlName="nombre"
- >
- </div>
- <div class="form-group">
- <label for="nombre">Select</label>
- <select
- class="form-control"
- formArrayName="selectValues"
- [(ngModel)]="array"
- >
- <option *ngFor="let i of array; let idx= index" [ngValue]="c" [formControlName]="array[idx]">{{i}}</option>
- </select>
- </div>
- <div class="form-group">
- <button type="submit" class="btn btn-outline btn-primary">Enviar</button>
- </div>
- </form>
- </div>
- {{forma.valid}}
- </mat-card>
- </div>
- import { Component } from '@angular/core';
- import { FormGroup, FormControl, Validators, FormArray } from '@angular/forms';
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.scss']
- })
- export class AppComponent {
- title = 'mapas';
- forma: FormGroup;
- array: any[] = ['a','b','c'];
- //Para poner mas validaciones se ponen entre [] y no separados por coma ya que el tercer parametro es para validaciones async
- constructor(){
- this.forma = new FormGroup({
- 'nombre': new FormControl('Mathias', Validators.required),
- 'selectValues': new FormArray([
- new FormControl(this.array)
- ])
- })
- }
- buscar(){
- console.log(this.forma.value);
- console.log(this.forma.value['selectValues'])
- this.forma.reset();
- }
- }
Add Comment
Please, Sign In to add comment