For reference: I write in TypeScript, Ionic, Angular 2 are involved in the bundle.
There is a component that contains the class IngridlistPage with the following code inside:
export class IngridlistPage { public dbingrids: string = "test"; constructor() {}; } There is a second component that contains the class IngridsearchPage with the following code inside:
import { IngridlistPage } from '../ingridlistpage' export class IngridsearchPage { ionViewDidLoad() { console.log(IngridlistPage['deb']); } } The output in the console after loading the page IngridsearchPage: undefined. I tried to get the value by the getter, tried to initialize in the constructor, and declare it outside, tried to declare the constructor argument, tried to access via .prototype. If you contact IngridlistPage.dbingrids directly, it displays: "property IngridlistPage 'typeof
I can create an object based on a class and access the property of a newly-minted object, it does not cause errors, only this solution does not suit me, since In the IngridlistPage class, there are methods that work with the dbingrids string. After all, if I want to add an ingredient to IngridsearchPage, and then delete it in IngridlistPage, I have to work with the same line .
Many thanks for the attention paid to my question.