UI には angularjs を使用し、バックエンド (REST サーバー) には codeigniter を使用します。codeigniter のみを使用している場合、ページネーションの作成方法は知っていますが、この状況を作成する方法を理解できます。その目的のために、それをテストする関数を 1 つ作成します。
したがって、REST サーバー (codeigniter) では、テスト用の関数を作成しました。
$this->load->library('pagination');
$config['base_url'] = 'http://localgost/test';
$config['total_rows'] = 200;
$config['per_page'] = 20;
$this->pagination->initialize($config);
$links = $this->pagination->create_links();
$this->response($links, REST_Controller::HTTP_OK);
UI 側 (angularjs) では、HTTP リクエストで文字列を取得します。
<strong>1</strong><a href="http://localhost/test/20" data-ci-pagination-page="2">2</a><a href="http://localhost/test/40" data-ci-pagination-page="3">3</a><a href="http://localhost/test/20" data-ci-pagination-page="2" rel="next">></a><a href="http://localhost/test/180" data-ci-pagination-page="10">Last ›</a>
しかし、この文字列をページネーション ボタンに変換する方法がわかりません。
どうすればそれを作ることができるか、また可能かどうか知っている人はいますか? このテストに成功すれば、すべてのページのページネーションを簡単に作成できます。