项目作者: bree7e

项目描述 :
Angular directive that render helper text to the right of input text
高级语言: TypeScript
项目地址: git://github.com/bree7e/ngx-input-suffix.git
创建时间: 2019-10-27T16:13:59Z
项目社区:https://github.com/bree7e/ngx-input-suffix

开源协议:

下载


ngx-input-suffix

Demo

ngx-input-suffix demo

Demo application

Installation

To install this library, run:

  1. $ npm install ngx-input-suffix ngx-window-token --save

and then import module:

  1. import { BrowserModule } from '@angular/platform-browser';
  2. import { NgModule } from '@angular/core';
  3. import { AppComponent } from './app.component';
  4. import { NgxSuffixModule } from 'ngx-input-suffix'; // <===
  5. @NgModule({
  6. declarations: [
  7. AppComponent
  8. ],
  9. imports: [
  10. BrowserModule,
  11. NgxSuffixModule // <===
  12. ],
  13. providers: [],
  14. bootstrap: [AppComponent]
  15. })
  16. export class AppModule { }

Usage

ngxSuffix should place inside ngxSuffixWrapper

  1. <div ngxSuffixWrapper>
  2. <input ngxSuffix=".example.com"/>
  3. </div>

Customization

There is --ngx-input-suffix__text-color css variable to set suffix color. Default color is grey.

  1. .wrapper {
  2. --ngx-input-suffix__text-color: black;
  3. }