I have two screens:
- Screen1(Empleado-empleado-form.js, empleado-form.js is called from empleado.js) where Service1 is injected.
- Screen2(Departamento-departamento.js) where Service 2 is injected
This is a repro of my error:
- When navigating to Screen1 the Service1 is injected.
- When navigating to Screen2 Service2 is injected.
- When navigating back to Screen1, Service2 is injected.
I suppose that the intented behavior is that each Service is injected into the screen with @injected not to randomly inject to the next Screen.
This is the github's project: https://github.com/DiegoGallegos4/aurelia-test;
- Screen 1 is located: src/departamento(services is inside)
- Screen 2 is located: src/empleado(service is inside, empleado-form.js is where empleado-service.js is injected.)
I use the following pattern:
@inject(Screen1Service)
export class Screen1{
constructor(service){
this.service = service
}
...service use to fetch/post data
}
If a repro is needed, let me know I can make a gist using promises. However, I dont know is navigation would be available on gist.