loading...

re: Passing data between nested components with Angular VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi No the path, the image I have in a json file

So if you've imported input like this:

import { component, input} from `@angular/core`

What does your HTML markup look like?

Since I cant find the solution, Im trying to assign the Image to a global variable and then assign it to a local var

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

Code of Conduct Report abuse