Answer the question
In order to leave comments, you need to log in
How to get the name of an object's key without knowing how many there are?
Task:
We have an array of objects of the form
[
{title: "Title", description: "Description", secret: {ХЗ СКОЛЬКО СВОЙСТВ ОБЪЕКТА И ИМЕН ТОЖЕ НЕ ЗНАЕМ},
{title: "Title 2", description: "Description 2", secret: {ХЗ СКОЛЬКО СВОЙСТВ ОБЪЕКТА И ИМЕН ТОЖЕ НЕ ЗНАЕМ 2}
]
td.item-title
editable-text(value='item.title')
td.item-secret(ng-repeat='secretItem in Keeper.data[{{$index}}].secret')
editable-text(value='secretItem.$КАК_ССЫЛАТЬСЯ_НА_СВОЙСТВО_ОБЪЕКТА_secret$',)
td.item-description
editable-text(value='item.description')
Answer the question
In order to leave comments, you need to log in
Excuse me for the reaction, but how could a fly not go in and read the very first example of the angular documentation? https://docs.angularjs.org/api/ng/directive/ngRepeat
Iterating over object properties
Is documentation really that hard? What is the generation of Stackoverflowers?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question