“Angular-ui bootstrap”を使用して、Bootstrap3のJavaScript部分をAngularJSに置き換えることができます。今回はcarouselのサンプルを作成しました。
※オンラインマニュアル
Angular directives for Bootstrap
Angular-ui bootstrap : 2.5.0
AngularJS : 1.6.5
Bootstrap : 3.3.7
Slide {{slide.id + 1}}
{{slide.text}}
<!DOCTYPE html>
<html ng-app="demoApp">
<head>
......
<script src="../js/angular-1.6.5.min.js"></script>
<script src="../js/ui-bootstrap-tpls-2.5.0.min.js"></script>
<link href="../js/app.js">
<link href="../css/bootstrap-3.3.7.min.css" rel="stylesheet">
</head>
.....
<div ng-controller="CarouselDemoCtrl">
<div style="height: 305px">
<div uib-carousel active="active" interval="myInterval" no-wrap="noWrapSlides">
<div uib-slide ng-repeat="slide in slides track by slide.id" index="slide.id">
<img ng-src="{{slide.image}}" style="margin:auto;">
<div class="carousel-caption">
<h4>Slide {{slide.id + 1}}</h4>
<p>{{slide.text}}</p>
</div>
</div>
</div>
</div>
</div>
var demoApp = angular.module('demoApp', ['ui.bootstrap']);
demoApp.controller("CarouselDemoCtrl", function($scope) {
$scope.myInterval = 5000;
$scope.noWrapSlides = false;
$scope.active = 0;
$scope.slides = [
{
image: 'http://placekitten.com/g/600/300',
text: 'one',
id: 0
},
{
image: 'http://placekitten.com/g/601/300',
text: 'two',
id: 1
},
{
image: 'http://placekitten.com/g/602/300',
text: 'three',
id: 2
},
];
});
- ブートストラップ3のサンプルレイアウトoffcanvasの設定方法
- Bootstrap3のtabを使って目次、表示の切り替え
- ブートストラップ3のグリッドの挙動をまとめました
- ブートストラップ3のaffixとScrollSpyを使ったサンプルレイアウト
- Bootstrapのフリーのテーマを使ってデザインを簡単にカスタマイズ
- Bootstrap3でリスト、リストグループ、パネルの階層を折りたたみ(collapse)
- Bootstrap3のサンプルOffcanvasのJavaScriptをAngularJSで書き換え
- Bootstrap3でAngularJSを使用 accordion
- Bootstrap3でAngularJSを使用 carousel
- Bootstrap3でAngularJSを使用 collapse
- Bootstrap3でAngularJSを使用 dropdown
- Bootstrap3でAngularJSを使用 datepicker
- Bootstrap3でAngularJSを使用 modal
- Bootstrap3でAngularJSを使用 tooltip、popover
- Bootstrap3でAngularJSを使用 tab
- Bootstrap3でAngularJSを使用 pagination
- Angular2とBootstrap4でAccordion
- Angular2とBootstrap4でCarousel
- Angular2とBootstrap4でドロップダウン
- Angular2とBootstrap4でツールチップ、ポップオーバー
- Angular2とBootstrap4でタブ
- Angular2とBootstrap4でページネーション(ページャー)
- Angular2とBootstrap4でcollapse
- Angular2とBootstrap4でモーダル
- Angular2とBootstrap4でdatepicker
Angular-ui bootstrap
ng-bootstrap(Angular2、Angular4)