Skip to content

Commit dfd500f

Browse files
author
Changyu Geng
committed
readme improvements and a minor bug fix
* readme add description of updateOn option * readme add disadvantage and overcoming of it * readme angular 2 is not **tested** * infinite-loop of twin upperCase and lowerCase directives bug fixed
1 parent 39e4dba commit dfd500f

File tree

11 files changed

+52
-10
lines changed

11 files changed

+52
-10
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ Compatible with Chrome, Safari, Edge & IE. Test status [![BrowserStack Status](h
2222

2323
Manually tested in Firefox.
2424

25+
## Package 2. ngx-upper-case-directive
26+
27+
> This directive helps to convert an input text value to upper case.
28+
29+
[Readme](projects/ngx-upper-case-directive/README.md)
30+
31+
## Package 3. ngx-lower-case-directive
32+
33+
> This directive helps to convert an input text value to lower case.
34+
35+
[Readme](projects/ngx-lower-case-directive/README.md)
36+
37+
## Package 4. ngx-cleave-directive
38+
39+
> This directive integrates cleave.js into Angular Form.
40+
41+
[Readme](projects/ngx-cleave-directive/README.md)
42+
2543
## Development & Contribution
2644

2745
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.3.

projects/ngx-cleave-directive/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ This directive integrates cleave.js into Angular Form.
44

55
It lies on a simple fact that *Angular listens to `input` event to bring the view-to-model binding into being*.
66

7-
The directive works with Angular 5 and 6. To use it in Angular 4, you may import the .ts file directly (see *Usage*). For Angular 2, you may try it in Angular 4's way, but it's not guaranteed to work.
7+
_* According to the description of [updateOn property of AbstractControlOptions interface](https://angular.io/api/forms/AbstractControlOptions), when updateOn is set to `blur` or `submit`, Angular listens to `blur` or `submit` event for model update. In this directive, `update-on-blur` case is handled in a hack way. No further processing is required for `update-on-submit` case._
8+
9+
Since extra `input` and `blur` events are dispatched, if you bind a callback to `input` event or `blur` event, the callback will be invoked twice on `input` or `blur`.
10+
11+
To overcome the disadvantage, a debounced function is recommended for the event binding.
12+
13+
The directive works with Angular 5 and 6. To use it in Angular 4, you may import the .ts file directly (see *Usage*). For Angular 2, you may try it in Angular 4's way, but it's not tested.
814

915

1016
## Usage

projects/ngx-cleave-directive/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-cleave-directive",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"author": "KingMario <[email protected]>",
55
"license": "MIT",
66
"bugs": {

projects/ngx-lower-case-directive/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ This directive helps to convert an input text value to lower case.
44

55
It lies on a simple fact that *Angular listens to `input` event to bring the view-to-model binding into being*.
66

7-
The directive works with Angular 5 and 6. To use it in Angular 4, you may import the .ts file directly (see *Usage*). For Angular 2, you may try it in Angular 4's way, but it's not guaranteed to work.
7+
_* According to the description of [updateOn property of AbstractControlOptions interface](https://angular.io/api/forms/AbstractControlOptions), when updateOn is set to `blur` or `submit`, Angular listens to `blur` or `submit` event for model update. In this directive, `update-on-blur` case is handled in a hack way. No further processing is required for `update-on-submit` case._
8+
9+
Since extra `input` and `blur` events are dispatched, if you bind a callback to `input` event or `blur` event, the callback will be invoked twice on `input` or `blur`.
10+
11+
To overcome the disadvantage, a debounced function is recommended for the event binding.
12+
13+
The directive works with Angular 5 and 6. To use it in Angular 4, you may import the .ts file directly (see *Usage*). For Angular 2, you may try it in Angular 4's way, but it's not tested.
814

915

1016
## Usage

projects/ngx-lower-case-directive/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-lower-case-directive",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"author": "KingMario <[email protected]>",
55
"license": "MIT",
66
"bugs": {

projects/ngx-lower-case-directive/src/lib/ngx-lower-case.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '@angular/core';
66

77
@Directive({
8-
selector: 'input[lowerCase]',
8+
selector: 'input[lowerCase]:not([upperCase])',
99
})
1010
export class NgxLowerCaseDirective {
1111

projects/ngx-trim-directive/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ This directive helps to trim whitespaces of an input text value.
44

55
It lies on a simple fact that *Angular listens to `input` event to bring the view-to-model binding into being*.
66

7-
The directive works with Angular 5 and 6. To use it in Angular 4, you may import the .ts file directly (see *Usage*). For Angular 2, you may try it in Angular 4's way, but it's not guaranteed to work.
7+
_* According to the description of [updateOn property of AbstractControlOptions interface](https://angular.io/api/forms/AbstractControlOptions), when updateOn is set to `blur` or `submit`, Angular listens to `blur` or `submit` event for model update. In this directive, `update-on-blur` case is handled in a hack way. No further processing is required for `update-on-submit` case._
8+
9+
Since extra `input` and `blur` events are dispatched, if you bind a callback to `input` event or `blur` event, the callback will be invoked twice on `input` or `blur`.
10+
11+
To overcome the disadvantage, a debounced function is recommended for the event binding.
12+
13+
The directive works with Angular 5 and 6. To use it in Angular 4, you may import the .ts file directly (see *Usage*). For Angular 2, you may try it in Angular 4's way, but it's not tested.
814

915

1016
## Usage

projects/ngx-trim-directive/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-trim-directive",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"author": "KingMario <[email protected]>",
55
"license": "MIT",
66
"bugs": {

projects/ngx-upper-case-directive/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ This directive helps to convert an input text value to upper case.
44

55
It lies on a simple fact that *Angular listens to `input` event to bring the view-to-model binding into being*.
66

7-
The directive works with Angular 5 and 6. To use it in Angular 4, you may import the .ts file directly (see *Usage*). For Angular 2, you may try it in Angular 4's way, but it's not guaranteed to work.
7+
_* According to the description of [updateOn property of AbstractControlOptions interface](https://angular.io/api/forms/AbstractControlOptions), when updateOn is set to `blur` or `submit`, Angular listens to `blur` or `submit` event for model update. In this directive, `update-on-blur` case is handled in a hack way. No further processing is required for `update-on-submit` case._
8+
9+
Since extra `input` and `blur` events are dispatched, if you bind a callback to `input` event or `blur` event, the callback will be invoked twice on `input` or `blur`.
10+
11+
To overcome the disadvantage, a debounced function is recommended for the event binding.
12+
13+
The directive works with Angular 5 and 6. To use it in Angular 4, you may import the .ts file directly (see *Usage*). For Angular 2, you may try it in Angular 4's way, but it's not tested.
814

915

1016
## Usage

projects/ngx-upper-case-directive/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-upper-case-directive",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"author": "KingMario <[email protected]>",
55
"license": "MIT",
66
"bugs": {

0 commit comments

Comments
 (0)