2.0.0 • Published 4 years ago
ngx-input-suffix v2.0.0
ngx-input-suffix
Angular directive that render helper text to the right of input text
Demo
Installation
To install this library, run:
$ npm install ngx-input-suffix ngx-window-token --save
and then import module:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NgxSuffixModule } from 'ngx-input-suffix'; // <===
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgxSuffixModule // <===
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Usage
ngxSuffix
should place inside ngxSuffixWrapper
<div ngxSuffixWrapper>
<input ngxSuffix=".example.com"/>
</div>
Support initial value
<div ngxSuffixWrapper>
<input ngxSuffix=".example.com" value="domain" />
</div>
<div ngxSuffixWrapper>
<input ngxSuffix=".angular.com" [(ngModel)]="domain" />
</div>
Customization
There is --ngx-input-suffix__text-color
css variable to set suffix color. Default color is grey.
.wrapper {
--ngx-input-suffix__text-color: black;
}