import { TestService } from '../../xxx'
export class TestPage {
public Num = this.testService.testNum
constructor( public testService:TestService) { }
this is my service
@Injectable()
export class Test{
public testNum:number = '123'
...
}
@Injectable()
export class TestService{
public testStr = 'aa'
...
}
I can get the property TestStr but cannot get the property testNum.
For some reason i can’t merge them together.
Please tell me how to solve this problem.
import { TestService } from '../../xxx'
export class TestPage {
public Num = this.testService.testNum
constructor( public testService:TestService) { }
this is my service
@Injectable()
export class Test{
public testNum:number = '123'
...
}
@Injectable()
export class TestService{
public testStr = 'aa'
...
}
I created two classes in a service, and I want to call the properties declared in the two classes from page, but I can only read the property (testStr) in class (TestService),unable to read property (testNum) in class (Test) from TestPage.
For some reason i can’t merge them together.
Please tell me how to solve this problem.
We’re a long way from something a 5-year old would understand.
What I’m trying to say is that I think you will end up happier in the long run if you allow people trying to help you to relax some assumptions, because I suspect even if this specific question gets answered, eventually it’s going to become irrelevant.