我正在做一个绘制其组件数据库的轮播,主要问题是它只能运行一次。 我留下代码: controlller:
'use strict';
// Carruselps controller
angular.module('carruselps').controller('CarruselpsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Carruselps',
function($scope, $stateParams, $location, Authentication, Carruselps) {
$scope.authentication = Authentication;
// Find a list of Carruselps
$scope.find = function() {
$scope.carruselps = Carruselps.query();
};
}
]);
HTML:
<section data-ng-controller="CarruselpsController" data-ng-init="find()">
<carousel interval="5000">
<slide ng-repeat="slide in carruselps" active="slide.active">
<img ng-src="{{slide.imagen}}" style="margin:auto;">
<div class="carousel-caption">
<h4>{{slide.titulo}}</h4>
<p>{{slide.subtitulo}}</p>
<a class="btn btn-default" href="{{slide.boton}}">Ver más</a>
</div>
</slide>
</carousel>
</section>
和前面元素:
<div ng-include="'modules/carruselps/views/carruselp.client.view.html'" id="c1"></div>