Gopard
Gopard

Reputation: 1060

AngularJS directive above table

I have table and template directive rnRow

<table>
<tr><td><span  class="text-primary ">0 :</span></td><td><span class="text-default "> 3</span></td></tr>
<rn-Row ng-Fieldcaption="<" ng-Fieldvalue=">"></rn-Row>
<rn-Row ng-Fieldcaption="-" ng-Fieldvalue="+"></rn-Row>
<rn-Row ng-Fieldcaption="Left" ng-Fieldvalue="Right"></rn-Row>
<tr><td><span  class="text-primary ">1 :</span></td><td><span class="text-default "> 2</span></td></tr>
</table>


 template: '<tr><td><span >{{ngFieldcaption}} :</span></td><td><span> {{ngFieldvalue}}</span></td></tr>'

http://jsfiddle.net/49uFF/

and result

but I want to see

What am I doing wrong?

Upvotes: 1

Views: 70

Answers (1)

Edminsson
Edminsson

Reputation: 2506

In this case I would use the attribute declaration

<body ng-app="demo">
    <table>
    <tr><td><span  class="text-primary ">0 :</span></td><td><span class="text-default "> 3</span></td></tr>
    <tr rn-Row ng-Fieldcaption="<" ng-Fieldvalue=">"></tr>
    <tr rn-Row ng-Fieldcaption="-" ng-Fieldvalue="+"></tr>
    <tr rn-Row ng-Fieldcaption="Left" ng-Fieldvalue="Right"></tr>
    <tr><td><span  class="text-primary ">1 :</span></td><td><span class="text-default "> 2</span></td></tr>
    </table>
</body>

Upvotes: 1

Related Questions