-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature/viscoll #217
base: develop
Are you sure you want to change the base?
Feature/viscoll #217
Conversation
terms: Array<term> = []; | ||
Data: any; | ||
|
||
constructor(private http: HttpClient) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better
constructor(
...
){
}
let observable = this.http.get('./assets/data/visColl.json'); | ||
observable.subscribe({next: (data:any)=> { | ||
this.Data=data; | ||
} | ||
}); | ||
observable.subscribe(() => this.assignmentcycle()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Join the two subscribes into one
|
||
assignmentcycle() { | ||
for (let rectocounter in this.Data.Rectos) { | ||
let side=JSON.parse(JSON.stringify(this.sampleSide)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why double encoding?
for (let termcounter in this.Data.Terms) { | ||
let term=JSON.parse(JSON.stringify(this.sampleTerm)); | ||
term=JSON.parse(JSON.stringify(this.Data.Terms[termcounter])); | ||
this.terms.push(term); | ||
|
||
for (let quirenumber in term.objects.Group) { | ||
this.quires[Number(term.objects.Group[quirenumber])-1].terms.push(term); | ||
}; | ||
|
||
|
||
for (let leafnumber in term.objects.Leaf) { | ||
this.leaves[Number(term.objects.Leaf[leafnumber])-1].terms.push(term); | ||
}; | ||
|
||
|
||
for (let rectonumber in term.objects.Recto) { | ||
this.rectos[Number(term.objects.Recto[rectonumber])-1].terms.push(term); | ||
}; | ||
|
||
for (let versonumber in term.objects.Verso) { | ||
this.versos[Number(term.objects.Verso[versonumber])-1].terms.push(term); | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor using arr.map
export class vceside { | ||
sidedata:sidedataType; | ||
terms:Array<term>; | ||
constructor(){} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove line
memberleaves:Array<vceleaf>; | ||
quireImg:string; | ||
terms:Array<term>; | ||
constructor(){} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove all empty constructors
terms:Array<term>; | ||
constructor(){} | ||
} | ||
export class term { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalize every class and interface type names
represents the Vercelli Book
retto -> recto
interface vcefolio -> vceside property foliodata ->sidedata interface foliodataType -> sidedataType interface foliodataParamsType -> sidedataParamsType this.leafs -> this.leaves
No description provided.