为什么html5lightbox不适用于angular
Why html5lightbox doesn't work with angular?
我使用html5lightbox在灯箱中打开图像和pdf文件。现在我添加了角度.js当单击链接时,它会将我带到其他页面,而不是在灯箱中打开它
var app = angular.module('MyApp', []);
var tiles =
[
{
class: "fileTile",
link: "images/9-credit-1.jpg",
header: "ToDo List",
content: "PDF File contains information about SAP sales and customers"
},
{
class: "videoTile",
link: "https://www.youtube.com/watch?v=Nfq3OC6B-CU",
header: "Fiori Tutorial",
content: "This Video contains information about SAP sales and customers"
},
{
class: "fileTile",
link: "images/canberra_hero_image_JiMVvYU.jpg",
header: "A Random Image",
content: "PDF File contains information about SAP sales and customers"
},
{
class: "fileTile",
link: "images/national-basketball-association-scoring-big-with-real-time-statistics-and-sap-hana.pdf?iframe=true",
header: "National Basketboal Team",
content: "PDF File contains information about SAP sales and customers"
}
];
app.controller("DisplayController", function($scope, $http){
$scope.tiles = tiles;
});
我能做些什么来使html5lightbox工作???
使用角度引导灯箱。简直太棒了。
这是工作普伦克
.html
<ul ng-controller="GalleryCtrl">
<li ng-repeat="image in images">
<a ng-click="openLightboxModal($index)">
<img ng-src="{{image.thumbUrl}}" class="img-thumbnail">
</a>
</li>
</ul>
JS(控制器)
angular.module('app').controller('GalleryCtrl', function ($scope, Lightbox) {
$scope.images = [
{
'url': '1.jpg',
'caption': 'Optional caption',
'thumbUrl': 'thumb1.jpg' // used only for this example
},
{
'url': '2.gif',
'thumbUrl': 'thumb2.jpg'
},
{
'url': '3.png',
'thumbUrl': 'thumb3.png'
}
];
$scope.openLightboxModal = function (index) {
Lightbox.openModal($scope.images, index);
};
});
演示
你确定有吗
data-lightbox
像标识符一样,这意味着此链接将显示在灯箱中。如果我真的记得,你必须为灯箱之类的代码提供这样的属性。
或者你能选择你试图使用的角度模板/html。
问候
相关文章:
- JQueryhide()不适用于Mozzilla,但适用于Chrome
- PHP中的setcookie仅适用于localhost
- html5 drawImage适用于firefox,而不是chrome
- 提供“;onClick"适用于iPad(触摸屏)和桌面用户的默认功能
- jQuery表单验证适用于Mozilla和Internet Explorer,但不适用于Chrome或Safari
- ResolveUrl是否适用于././也
- Firebase updateChildValues适用于IOS,但不适用于Web和Android
- JavaScript警报适用于int,但不适用于string
- SQLite插件适用于Mac和Windows,但不适用于手机上的Safari
- Regex Replace仅适用于Last Match
- window.onload适用于aspx页面,但不适用于普通html
- Jquery Ajax POST不工作.适用于GET
- 画布上的自定义字体仅适用于safari
- Angular js 适用于 jsfiddle 但不适用于我的机器 奇怪的错误
- Angular 2 是否仅适用于 NodeJS
- AngularJS中的依赖注入仅适用于Angular“对象”吗?
- Angular应用程序适用于Firefox/IE,但不适用于chrome
- 多时隙交叉是否适用于Angular 2组件
- 适用于 Angular.js 应用程序的身份验证 API
- HTTP基本身份验证适用于jQueryPOST请求,但不适用于Angular