R
R
RodgerFox2015-09-16 22:06:02
Angular
RodgerFox, 2015-09-16 22:06:02

What is the best way to organize the structure of data storage in an application?

I decided to create a menu builder, there are different types of menu objects (eg link to category, link to brand, custom link). You can choose a display style for each type, but there are several templates. Depending on them, the diz changes. menu, as well as a list of display options for each object, and a different set of fields in the array of menu objects can be used.
When the template changes, the array with fields can change:

{
id = id,
type = type,
name = name,
style = style, 
доп. поля...
items = [...]
}

Depending on the selected template, there may be different add-ons. fields. Is it correct to use copies of arrays with menu objects, but each will have its own extras. margins, and if the user decides to change the style. There will be a switch to another array (the constructed menu is shown below, how it will look on the site). And when you save the active "profile" is used to create a new menu. Or use one array with menu objects and a bunch of fields in it for each object?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Greg Popov, 2015-09-16
@Gregpopov

If your model looks like this when binded,
you are doing something wrong.
Better like this:
In general, google it at a time:
habrahabr.ru/post/181882

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question