Comments (3)
Sorry for the confusion, if you want to use galleryItemDef
you will need to add the item differently. Either use the interface GalleryItem
or galleryRef.add()
function
Here is the docs for galleryItemDef.
Here is a fixed stackblitz https://stackblitz.com/edit/ngx-gallery-5rmee4?file=src%2Fmain.ts
The implementation reserves the main types for the predefined templates.
from ngx-gallery.
Ah, thanks so much for that clarification and updates to the documentation! That works well.
One additional point that may be worth mentioning in the documentation is that if you have strict templates on in the project, you may have to work around the compiler complaining about certain variants of GalleryItemData
not having certain properties. That can be seen in the screenshot below. Note that I'm I am not doing any sort of check on the type
field, as I know that I only have images in this list of items:
![image](https://private-user-images.githubusercontent.com/10372284/265504468-5d7bdf99-76e1-4679-81b7-b2e0d9e0e7de.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDkwNjY2OTAsIm5iZiI6MTcwOTA2NjM5MCwicGF0aCI6Ii8xMDM3MjI4NC8yNjU1MDQ0NjgtNWQ3YmRmOTktNzZlMS00Njc5LTgxYjctYjJlMGQ5ZTBlN2RlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjI3VDIwMzk1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI2N2Q3NzU1ODYxM2I1MTcwNzg4MjhhMDg5ZDU4N2ZjZTg0ZWE3YjE0YjFmNGQ3MGE2MjhlNDYyM2M1OGEyOTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JAia4Onos-bY-H1vLs9IoCfTK_saNIKF9AWg_inEjHs)
I found that I had to wrap item
in $any(item)
to get around the compiler check there.
from ngx-gallery.
@tvsbrent Thanks for mentioning, will review what can be done to improve it
from ngx-gallery.
Related Issues (20)
- ng-gallery not working with [email protected] HOT 1
- add a angular pipe for protected images HOT 3
- Create a storybook documentation HOT 1
- Constant cpu usage on idle page HOT 1
- GalleryConfig in sub components HOT 2
- galleryRef config not working HOT 3
- Black borders on the left/right on some configurations HOT 3
- Performance / too many ChangeDetections [ng-gallery < 8.0.0] HOT 2
- Suggestions for Two Additional Thumbnail Features HOT 1
- Gallery Config overwritten in GalleryService `ref` method
- ng-gallery.mjs:287 [NgGallery]: Unable to set the active item because the given index (1) is outside the items range! HOT 2
- Lightbox: Use the native dialog element instead of CDK dialog
- Thumbnails are not aligned at the start HOT 2
- cant install it -new to angular- HOT 1
- Make it possible to use the gallerize directive in a container in which gallery items are added and removed dynamically. HOT 2
- itemTemplate for Lightbox Gallery HOT 12
- (click) dynamically change class HOT 1
- capture currently visible and clicked image HOT 3
- Fix custom item template documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-gallery.