Angular-UI-Bootstrap-Karussell nicht funktioniert

Möchte ich ein Karussell mit angular und Bootstrap, aber es funktioniert einfach nicht. Ich kann nicht sehen, das Karussell und ich sehe eckig ist brackett.

In anderen Worten, mein Fazit ist:

Hallo {{name}} das sind Ihre Fotos:
Schieben Sie {{$index+1}}

Dies ist mein index.html

<!doctype html>
<html ng-app="app">
<head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-animate.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.2.1.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">

    <script src="script.js"></script>
    <link href="style.css" rel="stylesheet">
</head>
<body>
    <div>
        Write your name here <input type="text" ng-model="name">
        Hi {{name}} Those are your photos:  
        <div ng-controller="CarouselDemoCtrl" id="slides_control">
            <div>
                <uib-carousel interval="myInterval">
                    <uib-slide ng-repeat="slide in slides" active="active" index="$index">
                        <img ng-src="{{slide.image}}" style="margin:auto;">
                        <div class="carousel-caption">
                            <h4>Slide {{$index+1}}</h4>
                        </div>
                    </uib-slide>
                </uib-carousel>
            </div>
        </div>
    </div>  
</body>
</html>

und das ist mein javascript script.js

var myApp = angular.module('app', ['ui.bootstrap']);
myApp.controller('CarouselDemoCtrl', CarouselDemoCtrl);
function CarouselDemoCtrl($scope){
    $scope.myInterval = 3000;
    $scope.slides = [
                     {
                       image: 'http://lorempixel.com/400/200/'
                     },
                     {
                       image: 'http://lorempixel.com/400/200/food'
                     },
                     {
                       image: 'http://lorempixel.com/400/200/sports'
                     },
                     {
                       image: 'http://lorempixel.com/400/200/people'
                     }
                   ];
});

BEARBEITEN ich habe die codes oben nach, was die Antwort unten sagt. Es funktioniert immer noch nicht

Sie nie wirklich definieren einen controller. Siehe docs.angularjs.org/guide/controller
Sie haben bereits diesem Beispiel die Arbeit in einem codepen als erstes Ergebnis der Google - codepen.io/Fabiano/pen/LACzk Sie die Kopie eingefügt, wo einige, und es funktioniert nicht
als str, sagte aktualisieren Sie den code mit der app.controller('CarouselDemoCtrl', CarouselDemoCtrl); vor der Funktion
angular-ui.github.io/bootstrap/#/carousel verwenden Sie geeignete Richtlinien
Antwort N. V. Prasad, Der link ist genau das, wo ich nahm es aus. Ich verstehe nicht, warum es funktioniert nicht auf mich

InformationsquelleAutor | 2016-03-03

Schreibe einen Kommentar