@ngageoint/seed-images
v5.0.1
Published
Angular component for Seed image discovery
Downloads
51
Readme
Seed Images
An Angular component for Seed image discovery
Install
npm install --save seed-images
Dependencies
Environment
The seed-images component expects two environment properties to be set:
scale
: In order for the component to properly display either the seed manifest JSON or a Scale import button, ascale
property must be set in the project's environment object. The value should betrue
if seed-images is being used within a Scale UI.siloUrl
: The URL of a valid SILO instance.
How to use
- Import into app module:
import { SeedImagesModule } from 'seed-images';
environment
(required): reference to an Angular environment object (see above).imageImport
: event emitted when the "Import" button is clicked. Its payload is the image manifest JSON.
environments/environment.ts
export const environment = {
production: false,
scale: false,
siloUrl: 'http://mySiloApi.com'
};
environments/environment.prod.ts
export const environment = {
production: true,
scale: false,
siloUrl: 'http://mySiloApi.com'
};
app.component.ts
import { Component } from '@angular/core';
import { environment } from '../environments/environment';
...
export class AppComponent {
env = environment;
constructor() {}
// method to handle image import if scale environment var is true
onImageImport(image) {
console.log(image.job, image.manifest);
}
...
}
app.component.html
<seed-images [environment]="env"></seed-images>
or, if scale: true
<seed-images [environment]="env" (imageImport)="onImageImport($event)"></seed-images>
Release and Publish to NPM
- Login to NPM with a valid NPM account
- Commit any relevant changes
- Execute
npm run release
to cut a new version - Update package-dist.json file with current version information
- Execute
npm run build
to compile app - Inside the
dist
directory, executenpm publish
- Execute
git push --follow-tags origin master