arhan892014-07-10 13:59:14
arhan89, 2014-07-10 13:59:14

AngularJS needs to display products and details for them in one table, how correct from the point of view of the value of the valid layout?

Using AngularJS in my project and to display products with details I use the following code,
naturally after such rendering in one table. it turns out several "tbody"
I would like to avoid this. Is there a possibility? , or it is admissible from the point of view of imposition.
I repeat, everything works as I need, it's just a matter of code aesthetics.

<tbody ng-repeat="item in document.products">
                <tr data-item="{{item.id}}"  class="item" ng-click="showDetail(item.id)">
                    <td class="text-center product-article" data-item="{{item.id}}">{{item.article}}</td>
                    <td class="product-name">{{item.name}}</td>
                    <td class="text-center product-count">
                        <input type="text"  min="0" max="99"  class="input-xs"  ng-model="item.productCount"/>
                    <td colspan="7"></td>
                    <td  class="text-center">
                        <button class="btn btn-xs btn-danger" ng-click="removeItem(item.id)">
                            <span class="glyphicon glyphicon-remove"></span>
                <tr ng-repeat="detail in item.details"  class="detail {{detail.attr.show}}">
                    <td class="text-center product-article" data-item="{{item.id}}">{{detail.attr.article}}</td>
                    <td class="detail-name">{{detail.attr.name}}</td>
                    <td class="text-center product-count">{{item.productCount * detail.attr.count}}</td>
                    <!--стоимости работ-->
                    <!--Сварочные работы-->
                    <td class="text-center work-count" data-per_untit_cost="">{{detail.works.3}}</td>
                    <td class="text-center work-count" data-total_cost="">{{item.productCount * detail.works.3 * detail.attr.count | number:2}}</td>
                    <!--Слесарные работы-->
                    <td class="text-center work-count" data-per_untit_cost="">{{detail.works.1}}</td>
                    <td class="text-center work-count" data-total_cost="">{{item.productCount * detail.works.1 * detail.attr.count | number:2 }}</td>
                    <!--Порошковая покраска-->
                    <td class="text-center work-count" data-per_untit_cost="">{{detail.works.9}}</td>
                    <td class="text-center work-count" data-total_cost="">{{item.productCount * detail.works.9 * detail.attr.count | number:2 }}</td>
                    <!--Упаковка и маркировка-->
                    <td class="text-center work-count" data-per_untit_cost="">{{detail.works.8 }}</td>
                    <td class="text-center work-count" data-total_cost="">{{item.productCount * detail.works.8 *  detail.attr.count | number:2 }}</td>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Konstantin Kitmanov, 2014-07-10

Multiple <tbody> tags are allowed within... .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question