
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
ng-gallery
Advanced tools
Angular image gallery simplifies the process of creating beautiful image gallery for the web and mobile devices.
Angular image gallery simplifies the process of creating beautiful image gallery for the web and mobile devices.
Install it with npm
npm install --save ng-gallery
If you are using SystemJS, you should also adjust your configuration to point to the UMD bundle.
In your systemjs config file, map
needs to tell the System loader where to look for ng-gallery
:
map: {
'ng-gallery': 'node_modules/ng-gallery/bundles/ng-gallery.umd.js',
}
Import GalleryModule
and set the gallery configuration in your root module
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { GalleryModule } from 'ng-gallery';
export const config : GalleryConfig = {
// ...
}
@NgModule({
imports: [
// ...
BrowserAnimationsModule,
GalleryModule.forRoot(config)
]
})
After that add <gallery></gallery>
in the template, see basic example
Or if you want to open the gallery in an overlay, use the service gallery.open()
, see gallery overlay example
Finally, load the images and there are two options:
images = [
{
src: "",
text: "anything",
"thumbnails: ""
},
{
src: "",
text: "",
"thumbnails: ""
},
];
constructor(private gallery: Gallery) { }
ngOnInit() {
this.gallery.load(images);
}
[gallerize]
directive<div gallerize>
<img src='assets/img/img3.jpg' alt='Spring'>
<img src='assets/img/img4.jpg' alt='Fire'>
<img src='assets/img/img5.jpg' alt='Peacock'>
</div>
Load images with specific class name
<div gallerize='cars'>
<img class='cars' src='assets/img/img3.jpg' alt='BMW'>
<img class='cars' src='assets/img/img4.jpg' alt='Toyota'>
<img class='bikes' src='assets/img/img5.jpg' alt='S800'>
</div>
Gallery Module relies on HammerJS for gestures, make sure it is loaded into the application.
You can add HammerJS to your application via npm, a CDN (such as the Google CDN), or served directly from your app.
To install via npm, use the following command:
$ npm install --save hammer.js
After installing, import it on your app's root module
import 'hammerjs';
If you identify any errors in this module, or have an idea for an improvement, please open an issue. I am excited to see what the community thinks of this project, and I would love your input!
FAQs
Angular Gallery
The npm package ng-gallery receives a total of 20,245 weekly downloads. As such, ng-gallery popularity was classified as popular.
We found that ng-gallery demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.