【问题标题】:Angularjs ui bootstrap carousel tag not recognized in html editorhtml编辑器中无法识别Angularjs ui引导轮播标签
【发布时间】:2015-10-08 07:29:55
【问题描述】:

我将angular-bootstrap 用于carousel,但问题是,在我的html 编辑器<carousel> and <slide> tag is not recognized 中,没有显示轮播、滑块、没有控件或指示器:(

我正在使用 angular#1.4.5 、 angular-bootstrap#0.13.4 和 bootstrap#3.2.0

我也厌倦了更改顺序但没有结果,它在 plunker 中运行良好。

任何建议,谢谢。

控制器-

angular.module('app', ['ui.bootstrap']);

function CarouselDemoCtrl($scope) {
  $scope.myInterval = "false";
  $scope.slides = [{
    Heading: " Cards",
    list_categories: [{
      id: 'bc1',
      name: ' card 1',
      response: 'Hello,  card 1'
    }, {
      id: 'bc2',
      name: ' card 2',
      response: 'Hello,  card 2'
    }, {
      id: 'bc2',
      name: ' card 3',
      response: 'Hello,  card 1'
    }]
  }, {
    Heading: "Documents",
    list_categories: [{
      id: 'd1',
      name: 'Template1',
      response: 'Hello,  1'
    }, {
      id: 'd2',
      name: 'Template2',
      response: 'Hello,  2'
    }, {
      id: 'd2',
      name: 'Template2',
      response: 'Hello,  3'
    }]

  }, {
    Heading: "Other Types",
    list_categories: [{
      id: 'o1',
      name: 'Other1',
      response: 'Hello,Others 1'
    }, {
      id: 'o2',
      name: 'Other2',
      response: 'Hello, Others 2'
    }, {
      id: 'o2',
      name: 'Other3',
      response: 'Hello, Others 3'
    }]

  }];
}

HTML文件-

<div ng-app="app">
  <div ng-controller="CarouselDemoCtrl" id="slides_control">
    <div>
      <carousel interval="myInterval">
        <slide ng-repeat="slide in slides" active="slide.active">
          <h2>{{slide.Heading}}</h2>
               <select id="sel" ng-model="selecteditem" class="input-block-level" ng-options="obj.response as obj.name  for obj in slide.list_categories"  >    
        <option value="">Select template</option>
                 
    </select>
          <h4>Response:  {{selecteditem}}</h>
          
         
          
        </slide>
      </carousel>
    </div>
  </div>
</div> 

这是我正在使用的命令-

【问题讨论】:

  • 更多信息,伙计,一些代码可能,错误,无论如何,拜托!
  • 如果它在 plunker 中正常工作,但在您的代码中却不能正常工作,那么要么您的代码不完全匹配,要么您在某处缺少脚本。为什么有人会投票这对我来说是迷失的。
  • 请看一下,我已经更新了html文件和控制器。

标签: angularjs carousel angular-bootstrap


【解决方案1】:

标签名称已更改为 uib-carousel 和 uib-slide

示例:

<uib-carousel interval="myInterval">
 <uib-slide ng-repeat="slide in slides track by $index" active="slide.active">
 <img ng-src="{{slide.image}}" style="margin:auto;">
 </uib-slide>
</uib-carousel>

【讨论】:

    猜你喜欢
    • 2016-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-23
    • 2023-03-22
    • 2016-01-10
    • 2020-09-06
    • 1970-01-01
    相关资源
    最近更新 更多