[英]Save dynamic user input - Angular
This is more like a logical question because I'm not finding a correct approach for this query.这更像是一个逻辑问题,因为我没有为此查询找到正确的方法。
I have 2 auditoriums with x amount of seats in the below fashion.我有 2 个礼堂,有 x 个座位,采用以下方式。
<div>
<pre>
Auditorium 1: A1 A2 A3 A4 A A6 A7 A8 A9
B1 B2 B3 B4 B5 B6 B7
C2 C3 C4 C5 C6 C7
</pre>
</div>
<div>
<pre>
Auditorium 2: A1 A2 A3 A4 A5 A6 A7
B2 B3 B4 B5 B6
C1 C2 C3 C4 C5 C6 C7 C8 C9
</pre>
</div>
I have stored these seat numbers using 2 arrays, one for each auditorium.我使用 2 个 arrays 存储了这些座位号,每个礼堂一个。 Now, if the auditorium owner decides to construct one more auditorium in his building, what would be an efficient way of asking the owner for his auditorium 3 seating arrangements dynamically, since they should be displayed in the above same way - seats one below another?
现在,如果礼堂所有者决定在他的建筑物中再建造一个礼堂,那么动态询问所有者他的礼堂 3 座位安排的有效方法是什么,因为它们应该以上述相同的方式显示 - 一个座位在另一个之下? and how would I dynamically store the seat numbers in an array at the same time?
以及如何将座位号同时动态存储在数组中?
Auditorium 3 example:
A1 A2 A3 A4 A A6 A7
B1 B2 B3 B4 B5 B6 B7 B8
C2 C3 C4 C5 C6 C7 C8 C9
You can get the data in the below format.,您可以获取以下格式的数据。,
let Auditorium3 = [A1, A2, A3, A4, A5, A6, A7, X, X, B1, B2, B3, B4, B5, B6, B7, B8, X, X, C2, C3, C4, C5, C6, C7, C8, C9]
which you will show in the below format excluding 'X' in your logic and considering maximum of A1 to A9(fully occupied A row) similarly, B1 to B9(fully occupied B row), C1 to C9(fully occupied C row)您将以以下格式显示,不包括逻辑中的“X”,并考虑 A1 到 A9(完全占用的 A 行)的最大值,B1 到 B9(完全占用的 B 行),C1 到 C9(完全占用的 C 行)
Auditorium 3 :
A1 A2 A3 A4 A A6 A7
B1 B2 B3 B4 B5 B6 B7 B8
C2 C3 C4 C5 C6 C7 C8 C9
Does this answer your question?这回答了你的问题了吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.