Answer the question
In order to leave comments, you need to log in
Why is the angular service cached?
I am making a calculator. Now I'm trying to separate the logic so that it's easier to edit and extend my calculator.
Faced with one problem, it should not arise in printsepi. I can't find the reason.
Example:
There is a main service that considers something
first.service.ts
basefunction(obj) {
var result = this.childrenservice.somefunction(obj);
console.log(result)
}
somefunction(obj) {
obj['Inventory'] = this.Inventory; //делает копию объекта
for (let y in details.Inventory) {
details.Inventory[y]['count'] = 1; // Создает елемент равным 1
}
details.Inventory['ItogMonth'] = 123123; // Добавляем какой то итог.
}
ERROR TypeError: Cannot create property 'count' on number '123123'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question