ng2-file-viewer
v1.1.1
Published
<section> <p>This component uses the <a href="http://ignitersworld.com/lab/imageViewer.html">Image Viewer JS</a> in it's core.</p> <p>Ng2-Image Viewer uses MIT license, so you can use it as you wish, feel free to help contributing with the code.</
Downloads
11
Maintainers
Readme
Welcome to Ng2-Image Viewer
Upgrading from prior to 3.0
Donate:
Installation
To install this library, run:
$ npm install iv-viewer --save
$ npm install ng2-image-viewer --save
Consuming the library
And then from your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { ImageViewerModule } from 'ng2-image-viewer';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Specify your library as an import
ImageViewerModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Now just add the these codes on your angular-cli.json file:
"styles": [
"../node_modules/ng2-image-viewer/imageviewer.scss"
],
Once your library is imported, you can use its components, directives and pipes in your Angular application:
<!-- You can now use your library component in app.component.html -->
<h1>
Image Viewer
</h1>
<app-image-viewer [images]="['iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', 'https://picsum.photos/900/500/?random']"
[idContainer]="'idOnHTML'"
[loadOnInit]="true"></app-image-viewer>
Changelog
Development
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
License
MIT © brenoprata10