I want to pass the value in one variable from one component to another component, this is what i got (Is angular1)
BuscarPlaya(){
console.log("Prueba");
var pais = $("#paisSelect").val();
var provincia = $("#provinciaSelect").val();
var ciudad = $("#ciudadSelect").val();
var playas= $("#playaSelect").val();
console.log(pais);
console.log(provincia);
console.log(ciudad);
console.log(playas);
if ((ciudad=="2")){
this.comillas=true;
} else if ((ciudad=="1")){
this.santander=true;
}
if ((pais=="1") && (provincia=="1")&&(ciudad=="1")&&(playas=="1")){
console.log("se escogio la playa el sardinero");
this.latitudBusqueda=43.473424;
this.longitudBusqueda=-3.782104;
}
}
i tried doing it by this way, but its not working
import { Component, OnInit, Input} from '@angular/core';
import { AgmCoreModule } from '@agm/core';
@Component({
selector: 'app-prueba',
templateUrl: './prueba.component.html',
styleUrls: ['./prueba.component.css']
})
export class PruebaComponent implements OnInit {
@Input('latitudBusqueda') lat:number;
@Input('longitudBusqueda') lng:number;
constructor() { }
ngOnInit() {
}
}
how can i get this variables to work in my PruebaComponent html