Reveal.js和angular - 背景故障

时间:2015-01-12 15:55:27

标签: angularjs reveal.js

我已经设置了数据背景属性。知道为什么这不起作用吗?



angular.module('app',[]).controller('SlidesController',['$scope','$timeout', function($scope,$timeout){
  
  $scope.slides = [
    { title:"I'm white - but should have some color",  background:"#22BB44"},
    { title:"...no color here? Why??",  background:"#99BB44"}  ];
  
  $timeout(function(){
     Reveal.initialize({
        autoSlide: 1500,
        loop:true
      });      
  }, 1000);
  
  
}]);

.slides section {
  font-size: 50px;
}

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="https://rawgit.com/hakimel/reveal.js/master/js/reveal.js"></script>
<link rel="stylesheet" href="https://rawgit.com/hakimel/reveal.js/master/css/reveal.css"></style>

<body ng-app="app" ng-controller="SlidesController">

  
  <div class="reveal">
    <div class="slides">
      <!-- this works -->
      <section data-background="#0000aa">
          I'm blue
      </section>
      
      <!-- this works, except for the background -->
      <section data-background="{s.background}" ng-repeat="s in slides">{{s.title}}</section>
      
    </div>
</div>

</body>
&#13;
&#13;
&#13;

0 个答案:

没有答案