Skip to content

Commit

Permalink
fixing prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
shameerrehman committed Aug 29, 2023
1 parent f5b8640 commit c1c9127
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 31 deletions.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ import { Component } from "@angular/core";

@Component({
selector: "my-app",
template: `<ngx-turnstile
[siteKey]="siteKey"
(resolved)="sendCaptchaResponse($event)"
theme="auto"
[tabIndex]="0"
></ngx-turnstile>`,
template: `<ngx-turnstile [siteKey]="siteKey" (resolved)="sendCaptchaResponse($event)" theme="auto" [tabIndex]="0"></ngx-turnstile>`,
})
export class MyApp {
sendCaptchaResponse(captchaResponse: string) {
Expand All @@ -68,21 +63,13 @@ You can then use the ngModel, formControl or formControlName directives on the c
### Reactive Form Example

```html
<ngx-turnstile
[siteKey]="siteKey"
theme="auto"
[formControl]="tokenControl"
></ngx-turnstile>
<ngx-turnstile [siteKey]="siteKey" theme="auto" [formControl]="tokenControl"></ngx-turnstile>
```

### Template Driven Form Example

```html
<ngx-turnstile
[siteKey]="siteKey"
theme="light"
[(ngModel)]="token"
></ngx-turnstile>
<ngx-turnstile [siteKey]="siteKey" theme="light" [(ngModel)]="token"></ngx-turnstile>
```

The component is read-only, meaning that you should not update the control with a custom value. Updating the control value will reset the component
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-turnstile-demo/src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
4 changes: 2 additions & 2 deletions projects/ngx-turnstile-demo/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
filter?: RegExp,
): {
<T>(id: string): T;
keys(): string[];
Expand All @@ -21,7 +21,7 @@ declare const require: {
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(),
);

// Then we find all the tests.
Expand Down
7 changes: 1 addition & 6 deletions projects/ngx-turnstile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ import { Component } from "@angular/core";

@Component({
selector: "my-app",
template: `<ngx-turnstile
[siteKey]="siteKey"
(resolved)="sendCaptchaResponse($event)"
theme="auto"
[tabIndex]="0"
></ngx-turnstile>`,
template: `<ngx-turnstile [siteKey]="siteKey" (resolved)="sendCaptchaResponse($event)" theme="auto" [tabIndex]="0"></ngx-turnstile>`,
})
export class MyApp {
sendCaptchaResponse(captchaResponse: string) {
Expand Down
8 changes: 4 additions & 4 deletions projects/ngx-turnstile/src/lib/ngx-turnstile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ declare global {
turnstile: {
render: (
idOrContainer: string | HTMLElement,
options: TurnstileOptions
options: TurnstileOptions,
) => string;
reset: (widgetIdOrContainer: string | HTMLElement) => void;
getResponse: (
widgetIdOrContainer: string | HTMLElement
widgetIdOrContainer: string | HTMLElement,
) => string | undefined;
remove: (widgetIdOrContainer: string | HTMLElement) => void;
};
Expand Down Expand Up @@ -50,7 +50,7 @@ export class NgxTurnstileComponent implements AfterViewInit, OnDestroy {

constructor(
private elementRef: ElementRef<HTMLElement>,
private zone: NgZone
private zone: NgZone,
) {}

private _getCloudflareTurnstileUrl(): string {
Expand Down Expand Up @@ -86,7 +86,7 @@ export class NgxTurnstileComponent implements AfterViewInit, OnDestroy {

this.widgetId = window.turnstile.render(
this.elementRef.nativeElement,
turnstileOptions
turnstileOptions,
);
};

Expand Down
4 changes: 2 additions & 2 deletions projects/ngx-turnstile/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
filter?: RegExp,
): {
<T>(id: string): T;
keys(): string[];
Expand All @@ -22,7 +22,7 @@ declare const require: {
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(),
);

// Then we find all the tests.
Expand Down

0 comments on commit c1c9127

Please # to comment.