Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AngularJS用户界面引导程序“;btn无线电“;指令不';行不通_Angularjs_Angularjs Directive_Angular Ui Bootstrap - Fatal编程技术网

AngularJS用户界面引导程序“;btn无线电“;指令不';行不通

AngularJS用户界面引导程序“;btn无线电“;指令不';行不通,angularjs,angularjs-directive,angular-ui-bootstrap,Angularjs,Angularjs Directive,Angular Ui Bootstrap,有人能解释为什么前两个按钮组有效,而第三个按钮组无效吗 <div class="btn-group"> <button ng-repeat="company in companies" class="btn" ng-model="radioModel.id" btn-radio="company.id"> {{company.name}} </button> </div&g

有人能解释为什么前两个按钮组有效,而第三个按钮组无效吗

<div class="btn-group">
  <button ng-repeat="company in companies" 
          class="btn" 
          ng-model="radioModel.id" 
          btn-radio="company.id">
    {{company.name}}
  </button>
</div>

<div class="btn-group">
  <button class="btn btn-two" 
          ng-model="radioModel.id"
          btn-radio="2">
    two
  </button>
  <button class="btn btn-two" 
          ng-model="radioModel.id"
          btn-radio="3">
    three
  </button>
</div>

<div class="btn-group">
  <button ng-repeat="company in companies" 
          class="btn btn-{{ company.name }}" 
          ng-model="radioModel.id" 
          btn-radio="company.id">
    {{company.name}}
  </button>
</div>

本例使用AngularUI引导程序0.5.0。如果我将其更改为0.3.0,则一切都会按预期工作。

使用
ng class
中的字符串插值很时髦

ng-class="'btn btn-' + company.name" 
ng-class="'btn btn-' + company.name"