Since I cant find the solution, Im trying to assign the Image to a global variable and then assign it to a local var
Yes @import() miImage: any;
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
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Since I cant find the solution, Im trying to assign the Image to a global variable and then assign it to a local var
Yes
@import() miImage: any;
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