我在角度控制器中设置无线电模型,但仅在表格的最后一列弹出窗口中设置了无线电模型。

ns-popover出现在表列单击上。

角度代码

var app = angular.module('app', ['nsPopover']);

app.controller('MainController', function ($q, $timeout) {
this.foo = "foobar!";

this.fields = [
    {id: 1, name: 'A'},
  {id: 2, name: 'B'},
  {id: 3, name: 'C'}
];

this.columns = [
    {
    id: 1,
    entries: [
        {columnType: 'a'},
      {columnType: 'b'},
      {columnType: 'c'}
    ]
  },
  {
    id: 2,
    entries: [
        {columnType: 'a'},
      {columnType: 'b'},
      {columnType: 'c'}
    ]
  },
  {
    id: 3,
    entries: [
        {columnType: 'a'},
      {columnType: 'b'},
      {columnType: 'c'}
    ]
  }
];

    $('#example').popover();
});


例子在这里
jsfiddle popup example

最佳答案

您缺少设置当前活动索引updated fiddle link的权限

$scope.setIndex = function(index) {

    this.currentIndex = index;
};
this.currentIndex = -1;

关于javascript - 为什么在ns-popover弹出窗口中未选择radio。仅在表格的最后一列弹出窗口中选择单选,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41457791/

10-12 02:20