Skip to content

Commit 132ad79

Browse files
authored
Merge pull request #56 from mpalourdio/standalone
chore: migrate to standalone components API
2 parents f67b023 + 3bc390e commit 132ad79

10 files changed

+477
-520
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## v0.13.0
4+
- Embrace standalone components and get rid of `NgModule`.
5+
36
## v0.12.0
47

58
- `angular 18` migration.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Use the fork, Luke. PR without tests will likely not be merged.
1515

1616
## What is it ?
1717

18-
It's an angular component to easily integrate [intl-tel-input](https://github.com/jackocnr/intl-tel-input).
18+
It's an angular standalone component to easily integrate [intl-tel-input](https://github.com/jackocnr/intl-tel-input).
1919

2020
## Installation
2121

package-lock.json

Lines changed: 464 additions & 451 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intl-tel-input-ng",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"scripts": {
55
"ng": "ng",
66
"build": "ng build",

src/lib/components/intl-tel-input.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<label [attr.for]="name" [ngClass]="labelCssClass" *ngIf="label && name" >{{label}}</label>
1+
@if (label && name) {
2+
<label [attr.for]="name" [ngClass]="labelCssClass" >{{ label }}</label>
3+
}
24
<input
35
type="text"
46
[ngClass]="cssClass"

src/lib/components/intl-tel-input.component.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ describe('IntlTelInputComponent', () => {
1818

1919
beforeEach(async () => {
2020
await TestBed.configureTestingModule({
21-
declarations: [
22-
IntlTelInputComponent,
23-
],
2421
imports: [
22+
IntlTelInputComponent,
2523
FormsModule,
2624
],
2725
providers: [

src/lib/components/intl-tel-input.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
*/
99

1010
import { AfterViewInit, Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
11-
import { ControlContainer, NgForm } from '@angular/forms';
11+
import { ControlContainer, FormsModule, NgForm } from '@angular/forms';
1212
import intlTelInput from 'intl-tel-input';
1313
import { IntlTelInputOptions } from '../model/intl-tel-input-options';
1414
import { IntlTelInput } from "../model/intl-tel-input";
15+
import { NgClass } from "@angular/common";
1516

1617
@Component({
1718
selector: 'intl-tel-input',
19+
standalone: true,
1820
templateUrl: './intl-tel-input.component.html',
1921
styleUrls: ['./intl-tel-input.component.scss'],
22+
imports: [NgClass, FormsModule],
2023
viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]
2124
})
2225
export class IntlTelInputComponent implements AfterViewInit {

src/lib/intl-tel-input-ng.module.spec.ts

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

src/lib/intl-tel-input-ng.module.ts

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

src/public_api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
export * from './lib/components/intl-tel-input.component';
66
export * from './lib/model/intl-tel-input-options';
77
export * from './lib/model/intl-tel-input';
8-
export * from './lib/intl-tel-input-ng.module';

0 commit comments

Comments
 (0)