angularjs和模板表 [英] angularjs and template table

查看:89
本文介绍了angularjs和模板表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想基于一个模型来构建一个HTML表格

I would like to build an html table based on a model

我想要做这样的事情。

Student         | competence 1                        |
                | subject 1                | subject 2|
                | exam 1 | exam2 | average |          |
xxxxx yyyyyyyyy |   10   | 20    |   15    | 45       |

这里是如何我试图做到这一点。

And here is how i'm trying to do this

table(ng-controller="ExaminationListCtrl")
  tr
    th(ng-repeat="(competence, s) in competenceToSubjectSize", colspan="{{s.length}}")
      {{competence}}
  tr
    th(ng-repeat="subject in subjects")
      {{subject.subject}}

我的问题是,我不能使用合并单元格={{s.length}},但在我看来,竞争力和s只绑定到个元素的子
我怎么能做到这一点?

My issue is that i can't use colspan="{{s.length}}", it seems to me that "competence" and s are only binded to the child of th elements How could i achieve this ??

推荐答案

我是错误的,因为顶部的标签,我们可以访问到标有NG重复范围

I was wrong since the top tag we could access to the scope marked with the ng-repeat

这篇关于angularjs和模板表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆