javascript - Angular cannot render carousel with template -


i using angular ui bootstrap components. goal create carousel using templateurl argument slide render, met problems. first of nothing appears when run page, tho errors:

here code: home.html

<section id="slider"> <!--slider--> <div class="container">     <div class="row" ng-controller="homecarouselctrl">         <div class="col-sm-12">             <carousel interval="myinterval" no-wrap="nowrapslides"  template-url="pages/templates/offer-product-tplt.html"/>         </div>     </div> </div> 

controler

mainapp.controller('homecarouselctrl', ['$scope', function ($scope) {     $scope.myinterval = 5000;     $scope.nowrapslides = false;     $scope.slides = [         {             slidetitle: 'free e-commerce template',             slidetext: 'lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua.',             slideimage: '../../images/home/cat1.jpg'         },         {             slidetitle: '100% responsive design',             slidetext: 'lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua.',             slideimage: '../../images/home/cat2.jpg'         },         {             slidetitle: 'free ecommerce template',             slidetext: 'lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua.',             slideimage: '../../images/home/cat3.jpg'         }      ]; }]); 

template: offer-product-tplt.html

   <slide ng-repeat="slide in slides" active="slide.active">     <div class="col-sm-6">         <h1><span>e</span>-shopper</h1>         <h2>{{slide.slidetitle}}</h2>         <p>{{slide.slidetext}}</p>         <button type="button" class="btn btn-default get">get now</button>     </div>     <div class="col-sm-6">         <img src="../../images/home/girl1.jpg" class="girl img-responsive" alt="" />         <img src="../../images/home/pricing.png" class="pricing" alt="" />     </div>    </slide> 

maybe can show me made mistake?

the templateurl attribute carousel shouldn't used in manner. should override default carousel template if want use own html slideshow controls. here's default carousel template fyi.

you'll need move <slide> <carousel>. if want reusable template what's inside slide, create directive that.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -