1
我有兩個嵌套的ng-repeat,我想多次添加相同的表格MiseEnContext,在這個「MiseEncontext」中我想添加一些輸入,但當我添加文本它被添加爲我的所有MiseEnContext 問題: 如何隔離我的MiseEncontext?如何使用ng-switch(angularjs)添加多個字段
'<h4>Exercice Redactionnel</h4>\
<ul>\
<li><a ng-click="addMiseEnContext()">Mise en context</a></li>\
<li><a ng-click="addQuestion()">Question</a></li>\
</ul>\
<div ng-repeat="exRedContent in exRedContents">\
<div ng-switch on={{exRedContentType}}>\
<div ng-switch-when="1">\
<h5>Mise en context</h5>\
Titre<input type="text" /><br />\
<button ng-click="addTexte(1)">addText</button>\
<div ng-repeat="MecField in MecFields">\
<div ng-switch on={{fieldsType}}>\
<div ng-switch-when="1">\
Text<input type="text">\
</div>\
<div ng-switch-when="2">\
<h5>Text illustré</h5></ br>\
Position: <input type="radio" name="group1" value="droit" checked>Text à droite<br />\
</div>\
</div>\
</div>\
</div>\
<div ng-switch-when="2">\
<h5>Question</h5>\
</div>\
</div>\
</div>'
演示:http://plnkr.co/edit/Cr0WN4hCuKTYJOfb5CBf?p=preview