JLL*_*JLL 2 javascript angularjs swiper ionic-framework
我使用了文档http://ionicframework.com/docs/nightly/api/directive/ionSlides/,基本上使用了入门应用程序模板.我将html添加到模板中,并将js部分添加到我的控制器中,但是它给出了错误ReferenceError:fade未定义并且没有显示任何内容..
有没有人有1.2.4离子的工作离子幻灯片示例?我的假设是他们改变了一些东西,但还没有为它制作文档.
这是我使用的代码,我将js部分添加到控制器,将html添加到我的视图中.
$scope.options = {
loop: false,
effect: fade,
speed: 500,
}
$scope.data = {};
$scope.$watch('data.slider', function(nv, ov) {
$scope.slider = $scope.data.slider;
})
Run Code Online (Sandbox Code Playgroud)
<ion-slides options="options" slider="data.slider">
<ion-slide-page>
<div class="box blue"><h1>BLUE</h1></div>
</ion-slide-page>
<ion-slide-page>
<div class="box yellow"><h1>YELLOW</h1></div>
</ion-slide-page>
<ion-slide-page>
<div class="box pink"><h1>PINK</h1></div>
</ion-slide-page>
</ion-slides>
Run Code Online (Sandbox Code Playgroud)
进入视图时,我收到此错误:
ReferenceError: fade is not defined
at new (controllers.js:22)
at invoke (ionic.bundle.js:17762)
at Object.instantiate (ionic.bundle.js:17770)
at ionic.bundle.js:22326
at self.appendViewElement (ionic.bundle.js:56883)
at Object.switcher.render (ionic.bundle.js:54995)
at Object.switcher.init (ionic.bundle.js:54915)
at self.render (ionic.bundle.js:56743)
at self.register (ionic.bundle.js:56701)
at updateView (ionic.bundle.js:62357)
Run Code Online (Sandbox Code Playgroud)
我使用的是夜间版本的示例,我的离子版本是1.2.4
对我来说有用的是将effect选项设置为字符串,因为我们正在做的事情(从他们的文档中编写和复制)传递给它一个名为的变量fade,当然我们没有定义它来解释错误.
所以将代码更改为
$scope.options = {
loop: false,
effect: 'fade',
speed: 500
}
Run Code Online (Sandbox Code Playgroud)
它应该工作.
下面是一个其他效果的列表,以及尝试:) slide或cube或coverflow
| 归档时间: |
|
| 查看次数: |
6654 次 |
| 最近记录: |