I have created a local instance of the service and accessing data from it directly. Is this incorrect if it is a simple use case (sharing data between components). I am trying to grasp some core concepts of ng2 and I feel like there may be a better option.
eg
export class FormTwoComponent implements OnInit {
private model: WinnerModel;
constructor(private formService: FormService, private router: Router) {}
ngOnInit() {
this.model = this.formService.winnerModel;
}
onSubmit() {
this.formService.winnerModel = this.model;
this.router.navigate(['/form/3'])
}
}
Thanks