2.4.0 • Published 5 years ago

@helt/remove-url-scheme v2.4.0

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

remove-url-scheme

npm (scoped) GitHub issues GitHub stars GitHub forks GitHub license

Removes scheme from URL, e.g. 'Http://'. Case insensitive

Author of regex expression: FailedDev

RegexExpVis

Install

$ npm install @helt/remove-url-scheme

Usage

1) Register the RemoveUrlSchemeModule in your app module.

import { RemoveUrlSchemeModule } from '@helt/remove-url-scheme';

import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RemoveUrlSchemeModule } from '@helt/remove-url-scheme';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    ...
    HttpClientModule,
    RemoveUrlSchemeModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}
 

2) Used through pipe operator in template or DI in component

<button mat-stroked-button>
    <i class="material-icons">language</i>
    {{'https://github.com' | removeUrlScheme}}
</button>
import { RemoveUrlSchemePipe } from '@helt/remove-url-scheme';

export class ExampleComponent implements OnInit {
  newUrl!: string;
  constructor(private removeUrlSchemePipe: RemoveUrlSchemePipe) {
    this.newUrl = this.rus.tranform('https://github.com');
  }
  ngOnInit() {
  }
}

https://github.com -> github.com

http://github.com -> github.com

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

0.2.0

5 years ago

0.0.0

5 years ago

1.0.0

5 years ago