Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple classes for property #97

Open
nmalocic opened this issue Apr 25, 2019 · 1 comment
Open

Multiple classes for property #97

nmalocic opened this issue Apr 25, 2019 · 1 comment

Comments

@nmalocic
Copy link

Hi i was wondering if it's possible to define multiple classes for one property.
I have:

export default class ErrorMessage {
    @serializable
    @observable
    public defaultText: string;

    @serializable
    @observable
    public errorCode: string;

    @serializable(object(Parameters))
    @observable
    public parameters: object;
}

And i have parameter class:

export default class Parameters {
    public objectName: string;
}

But in some cases we have more than one parameter and we need something like this:

export default class Parameters2 {
    public objectName1: string;
    public objectName2: string;
}

is it possible in ErrorMassage to pass both Parameters and Parameters2 to the object function?

Thanks

@nmalocic
Copy link
Author

Hi we have mapped parameters as like this and solved issue:

    @serializable(map(primitive()))
    @observable
    public parameters: any;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants