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

TreeChildren and TreeParent type function option as eg ManyToOne and OneToMany #4165

Open
nolazybits opened this issue May 19, 2019 · 0 comments

Comments

@nolazybits
Copy link

Issue type:

[ ] question
[ ] bug report
[x] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:
I'n using DI everywhere in my application and the types are resolved at runtime.
ManyToOne and OneToMany decorators have a type function options, like this for instance

@ManyToOne((ty: typeof IFamCategory) => StaticContainer.Get(IFamCategory), (category: IFamCategory) => category.childCategories)
public abstract parentCategory: IFamCategory;

it would be nice to have the same for the TreeChildren and TreeParent decorator like

@TreeChildren((ty: typeof IFamCategory) => StaticContainer.Get(IFamCategory))
public abstract childCategories: IFamCategory[];

@TreeParent((ty: typeof IFamCategory) => StaticContainer.Get(IFamCategory))
public abstract parentCategory: IFamCategory;

Thanks again for this awesome library.

Benjamin-Dobell added a commit to Benjamin-Dobell/typeorm that referenced this issue Jan 13, 2020
Benjamin-Dobell added a commit to Benjamin-Dobell/typeorm that referenced this issue Jan 13, 2020
Benjamin-Dobell added a commit to Benjamin-Dobell/typeorm that referenced this issue Jan 13, 2020
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

3 participants