bootstrap-table не заполняется внутри углового представления

Размещение начальной таблицы 1 на главной странице, кажется, работает, но как только она помещена в вид ничего не происходит.

Вот plunker для воспроизведения проблемы: http://plnkr.co/edit/n0J91B?p=preview. Вопрос: как изменить этот плункер, чтобы обе таблицы отображали данные?

<table data-toggle="table"
   data-url="/gh/get/response.json/wenzhixin/bootstrap-table/tree/master/docs/data/data1/">
<thead>
<tr>
    <th data-field="name">Name</th>
    <th data-field="stargazers_count">Stars</th>
    <th data-field="forks_count">Forks</th>
    <th data-field="description">Description</th>
</tr>
</thead>

In the plunker there shall be two tables, but only the top one shows up, the bottom one only the header shows up: enter image description here 1 http://bootstrap-table.wenzhixin.net.cn/examples/


person okigan    schedule 25.03.2015    source источник


Ответы (2)


вот URL-адрес plunker: теперь все работает нормально, обе таблицы показывают данные http://plnkr.co/edit/n0J91B?p=preview

.state('about', {
            url: '/about',
            views: {
                '': { templateUrl: 'partial-about.html' },
                'columnOne@about': { template: 'Look I am a column!' },
                'columnTwo@about': { 
                    templateUrl: 'table-data.html',
                    controller: 'scotchController'
                }
            }

        });
person D C    schedule 25.03.2015
comment
хм, все еще не появляется -- вы забыли сохранить планкер? также включите код, отрезанный так же, как и оригинал, поэтому неясно, каков ваш предполагаемый ответ - person okigan; 25.03.2015

Связался с авторами и разработчиками компонентов: https://github.com/wenzhixin/bootstrap-table/issues/650

Это привело к следующему решению (см. подробности в ссылке выше):

// HOME STATES AND NESTED VIEWS ========================================
.state('home', {
    url: '/home',
    templateUrl: 'partial-home.html',
    controller: function($scope) {
      $(function () {
        $('[data-toggle="table"]').bootstrapTable();
      });
    }
})
person okigan    schedule 28.03.2015