mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
docs: array initializers should be avoided (#5233)
* Update Category.ts Array initialisers should be avoided * Update app.ts
This commit is contained in:
parent
0872430638
commit
3c3ec34f26
@ -20,6 +20,7 @@ createConnection(options).then(connection => {
|
||||
category1.name = "category #1";
|
||||
|
||||
let mainCategory = new Category();
|
||||
mainCategory.manyCategories = [];
|
||||
mainCategory.name = "main category";
|
||||
mainCategory.oneCategory = category1;
|
||||
mainCategory.manyCategories.push(category1);
|
||||
|
||||
@ -33,17 +33,17 @@ export class Category {
|
||||
@OneToMany(type => Category, category => category.oneManyCategory, {
|
||||
cascade: true
|
||||
})
|
||||
oneManyCategories: Category[] = [];
|
||||
oneManyCategories: Category[];
|
||||
|
||||
@ManyToMany(type => Category, category => category.manyInverseCategories, {
|
||||
cascade: true
|
||||
})
|
||||
@JoinTable()
|
||||
manyCategories: Category[] = [];
|
||||
manyCategories: Category[];
|
||||
|
||||
@ManyToMany(type => Category, category => category.manyCategories, {
|
||||
cascade: true
|
||||
})
|
||||
manyInverseCategories: Category[] = [];
|
||||
manyInverseCategories: Category[];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user