0.0.4 • Published 5 years ago
ngx-image-tool v0.0.4
NgxImageTool
Angular directive for retrieving meta data about an image from Azure Cognitive Services. Just use your key and Go!
Like binding to a regular click event in a template, you can do something like this:
<img src="http://some-image.jpg" [ngxImageTool] [config]="{subscriptionKey:"my-key"}" (dataLoaded)="onDataLoaded($event)" />Installation
npm install --save ngx-image-toolUsage
Add NgxImageToolModule to your list of module imports:
import { NgxImageToolModule } from 'ngx-image-tool';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, NgxImageToolModule],
bootstrap: [AppComponent]
})
class AppModule {}You can then use the directive in your templates:
@Component({
selector: 'app',
template: `
<img src="http://some-image.jpg" [ngxImageTool] [config]="{subscriptionKey:"my-key"}" (dataLoaded)="onDataLoaded($event)" />
`
})
export class AppComponent {
onDataLoaded($event) {
console.log(JSON.stringify($event));
}
}Options
| Property name | Type | Default | Description |
|---|---|---|---|
options | any | {subscriptionKey:"my-key"} | Use your Azure Cognitive Services key here. |
