Injectable()
export class MyService{
public save(){
var name = this.name;
alert('my name is'+name );
}
}
Its working fine when i'm using same component.
but I didn't get value, when i'm coming from another component. I got only
empty alert. (i.e)
constructor(private myService:MyService){
this.myService.save();
}
How can i solve this issue?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.