DEV Community

Discussion on: Passing data between nested components with Angular

 
danielfrugoni profile image
DanielFrugoni

Yes
@import() miImage: any;

Thread Thread
 
danielfrugoni profile image
DanielFrugoni

Im trying something differet like this

@Injectable()
export class Globals {
public imagenUno: any;
}

then:
this.globals.imagenUno=data.Imagen;
console.log('Foto:'+this.globals.imagenUno) (I see the image in conole.log)

then I have image.componet.ts
import { Globals } from 'src/app/globals';

constructor(private globals: Globals ) {
console.log('Foto:'+this.globals.imagenUno) (get Foto:undefined)
}

Well I guess Im missing something with angular 7