angular-shorturl
v0.1.7
Published
To install this library, run:
Downloads
261
Maintainers
Readme
Angular-Shortener
To install this library, run:
$ npm install angular-shorturl --save
Consuming your library
You can import this library in any Angular application by running:
$ npm install angular-shorturl
and then from your Angular AppModule
:
import { ShorturlModule } from './modules/shorturl/shorturl.module';
import { ShortUrlService } from 'angular-shorturl';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
MapsModule,
HttpModule,
ShorturlModule
],
providers: [ShortUrlService],
bootstrap: [AppComponent]
})
export class AppModule { }
Once your library is imported, you can use it in your component. We'll show you how we can display our result in console.log('');
export class AppComponent {
constructor(private shortUrlService: ShortUrlService) {
this.shortUrlService.load('band.com.br/123').then((data) => {
console.log(data);
});
}
}
License
MIT © Thiago da Silva Adriano