Skip to content

Commit bac2a70

Browse files
Merge pull request #64 from thekip/angular-cli-ivy2
bootstrap library with ng-cli, ivy support
2 parents 37c9ae1 + 131a39a commit bac2a70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+10340
-12461
lines changed

.npmignore

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Angular CC Library - for validation and formating of input parameters
44

55
# Demo
66
1. Clone repo
7-
2. run `npm install`
8-
3. run `npm run dev`
7+
2. run `yarn install`
8+
3. run `yarn run:demo`
99
4. visit `http://localhost:4200`
1010

1111
# Usage
@@ -15,7 +15,7 @@ Angular CC Library - for validation and formating of input parameters
1515
npm install angular-cc-library --save
1616
```
1717

18-
## Formating Directive
18+
## Formatting Directive
1919
On the input fields, add the specific directive to format inputs.
2020
All fields must be `type='tel'` in order to support spacing and additional characters
2121

@@ -60,8 +60,8 @@ Will support format of MM/YY or MM/YYYY
6060
Current only Model Validation is supported.
6161
To implement, import the validator library and apply the specific validator on each form control
6262

63-
```javascript
64-
import { CreditCardValidator } from 'angular-cc-library';
63+
```typescript
64+
import { CreditCardValidators } from 'angular-cc-library';
6565

6666
@Component({
6767
selector: 'app',
@@ -81,9 +81,9 @@ export class AppComponent implements OnInit {
8181

8282
ngOnInit() {
8383
this.form = this._fb.group({
84-
creditCard: ['', [<any>CreditCardValidator.validateCCNumber]],
85-
expirationDate: ['', [<any>CreditCardValidator.validateExpDate]],
86-
cvc: ['', [<any>Validators.required, <any>Validators.minLength(3), <any>Validators.maxLength(4)]]
84+
creditCard: ['', [CreditCardValidators.validateCCNumber]],
85+
expirationDate: ['', [CreditCardValidators.validateExpDate]],
86+
cvc: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(4)]]
8787
});
8888
}
8989

angular.json

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"cli": {
5+
"packageManager": "yarn",
6+
"analytics": "d3a9c97d-1dcd-4643-99bd-20d73f0a2164"
7+
},
8+
"newProjectRoot": "projects",
9+
"projects": {
10+
"angular-cc-library": {
11+
"projectType": "library",
12+
"root": "projects/angular-cc-library",
13+
"sourceRoot": "projects/angular-cc-library/src",
14+
"prefix": "lib",
15+
"architect": {
16+
"build": {
17+
"builder": "@angular-devkit/build-ng-packagr:build",
18+
"options": {
19+
"tsConfig": "projects/angular-cc-library/tsconfig.lib.json",
20+
"project": "projects/angular-cc-library/ng-package.json"
21+
},
22+
"configurations": {
23+
"production": {
24+
"tsConfig": "projects/angular-cc-library/tsconfig.lib.prod.json"
25+
}
26+
}
27+
},
28+
"test": {
29+
"builder": "@angular-builders/jest:run",
30+
"options": {
31+
"tsConfig": "tsconfig.spec.json",
32+
}
33+
},
34+
"lint": {
35+
"builder": "@angular-devkit/build-angular:tslint",
36+
"options": {
37+
"tsConfig": [
38+
"projects/angular-cc-library/tsconfig.lib.json",
39+
"projects/angular-cc-library/tsconfig.spec.json"
40+
],
41+
"exclude": [
42+
"**/node_modules/**"
43+
]
44+
}
45+
},
46+
"deploy": {
47+
"builder": "ngx-deploy-npm:deploy",
48+
"options": {
49+
"access": "public"
50+
}
51+
}
52+
}
53+
},
54+
"example": {
55+
"projectType": "application",
56+
"schematics": {},
57+
"root": "projects/example",
58+
"sourceRoot": "projects/example/src",
59+
"prefix": "app",
60+
"architect": {
61+
"build": {
62+
"builder": "@angular-devkit/build-angular:browser",
63+
"options": {
64+
"outputPath": "dist/example",
65+
"index": "projects/example/src/index.html",
66+
"main": "projects/example/src/main.ts",
67+
"polyfills": "projects/example/src/polyfills.ts",
68+
"tsConfig": "projects/example/tsconfig.app.json",
69+
"aot": true,
70+
"assets": [
71+
"projects/example/src/favicon.ico",
72+
"projects/example/src/assets"
73+
],
74+
"styles": [
75+
"projects/example/src/styles.css"
76+
],
77+
"scripts": []
78+
},
79+
"configurations": {
80+
"production": {
81+
"fileReplacements": [
82+
{
83+
"replace": "projects/example/src/environments/environment.ts",
84+
"with": "projects/example/src/environments/environment.prod.ts"
85+
}
86+
],
87+
"optimization": true,
88+
"outputHashing": "all",
89+
"sourceMap": false,
90+
"extractCss": true,
91+
"namedChunks": false,
92+
"extractLicenses": true,
93+
"vendorChunk": false,
94+
"buildOptimizer": true,
95+
"budgets": [
96+
{
97+
"type": "initial",
98+
"maximumWarning": "2mb",
99+
"maximumError": "5mb"
100+
},
101+
{
102+
"type": "anyComponentStyle",
103+
"maximumWarning": "6kb",
104+
"maximumError": "10kb"
105+
}
106+
]
107+
}
108+
}
109+
},
110+
"serve": {
111+
"builder": "@angular-devkit/build-angular:dev-server",
112+
"options": {
113+
"browserTarget": "example:build"
114+
},
115+
"configurations": {
116+
"production": {
117+
"browserTarget": "example:build:production"
118+
}
119+
}
120+
},
121+
"extract-i18n": {
122+
"builder": "@angular-devkit/build-angular:extract-i18n",
123+
"options": {
124+
"browserTarget": "example:build"
125+
}
126+
},
127+
"lint": {
128+
"builder": "@angular-devkit/build-angular:tslint",
129+
"options": {
130+
"tsConfig": [
131+
"projects/example/tsconfig.app.json"
132+
],
133+
"exclude": [
134+
"**/node_modules/**"
135+
]
136+
}
137+
},
138+
"e2e": {
139+
"builder": "@angular-devkit/build-angular:protractor",
140+
"options": {
141+
"protractorConfig": "projects/example/e2e/protractor.conf.js",
142+
"devServerTarget": "example:serve"
143+
},
144+
"configurations": {
145+
"production": {
146+
"devServerTarget": "example:serve:production"
147+
}
148+
}
149+
}
150+
}
151+
}
152+
},
153+
"defaultProject": "angular-cc-library"
154+
}

example/main.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

example/polyfills.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

example/src/app.component.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

example/src/app.html

Lines changed: 0 additions & 24 deletions
This file was deleted.

example/src/app.module.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

example/vendor.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

index.html

Lines changed: 0 additions & 30 deletions
This file was deleted.

index.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

karma-test-shim.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)