Answer the question
In order to leave comments, you need to log in
How to replace objects not by reference, but by value?
All in all, changing the parent didn't do me any good, Angular didn't react at all. However, when I simply replaced the properties of the original parent object and called angular.element($( 'body' )).scope().$apply()
Then Angular redrawn the DOM for me
Please tell me, I have not come across this before, how to correctly replace all the properties of an object with the properties of another object? Is there any normal folk function or method in the standard?
For example:
I have an original object that Angular listens to:
let service = {
start: false, // запущена ли отрисовка
ye: 10, // условные единицы
kq: 1,
kF: 1,
base: {
A: 100, // A
L: 10, // L
q: false
},
structure: {
item: [], // KernelList
F: [],
leftSealing: false, // заделка слева
rightSealing: false // заделка
}
};
{
"start": true,
"ye": 10,
"kq": 1,
"kF": 1,
"base": {
"A": 100,
"L": 10,
"q": false
},
"structure": {
"item": [
{
"A": 100,
"L": 10,
"q": false
},
{
"A": 100,
"L": 10,
"q": 1
},
{
"A": 100,
"L": 10,
"q": false
},
{
"A": 100,
"L": 10,
"q": false
}
],
"F": [
null,
null,
null,
-1
],
"leftSealing": false,
"rightSealing": false
}
}
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