2016-09-24 4 views
0

내 코드에서 루핑을하면 두 개의 라디오 버튼 그룹이 생성됩니다. 나는 그룹의 한 라디오 버튼에 체크 인 할 때 예를 들어 은라디오 버튼 이름을 동적으로 변경하십시오.

문제가
RadioButton1: a.Yes b.no 

RadioButton2: a.Yes b.no 

, 나는, 라디오 버튼 dynamically.So의 이름을 변경할 수 없습니다 생각, 다른 그룹의 요소는 확인되고있다.

내 코드는 내가 이름을 작업해야

<div ng-repeat="t in getTimes(2) track by $index"> 
    <div> 
     <div> 
      <div ng-repeat="radioButton in 
            selection.head.avarageOrBestCount">s 
       <input type="radio" name=" 
            {{"avarageOrBestCount"+$parent.$index}}" 
        value="{{radioButton}}" ng-model="ss"> {{radioButton}}<br> 
      </div> 
     </div> 
     </div> 
    </div> 

을 - 이것도 = "{{"avarageOrBestCount "+ $ 부모입니다. $ 지수}}". 라디오 버튼의 이름을 어떻게 동적으로 변경할 수 있습니까?

+0

parent repear/scope에서 이름 인덱스에 추가하려고 시도합니다. –

+0

$ parent ... $ index ... yah .. 시도했지만 ... 작동하지 않았습니다. –

+1

name = " avarageOrBestCount {{$ parent. $ index}} " – Natiq

답변

0

속성 문자열을 위반했습니다. 큰 따옴표 " ''"또는 viceversa에 내 ... 여기에

name="{{"avarageOrBestCount"+$parent.$index}}" 

...

name="{{'avarageOrBestCount'+$parent.$index}}" 

를 사용하여 작은 따옴표를이을 변경합니다.

관련 문제