angularjs - Reload controller or ng-include -
i'm doing carousel draws components database, main problem works once. here leave codes: 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 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>
and front element:
<div ng-include="'modules/carruselps/views/carruselp.client.view.html'" id="c1"></div>
Comments
Post a Comment