Skip to content

Commit

Permalink
fix(component): handle id input parameter correctly
Browse files Browse the repository at this point in the history
Fix an issue with `id` input parameter. Now, if it is provided, recaptcha will work correctly
  • Loading branch information
DethAriel committed Mar 13, 2017
1 parent 4148523 commit b578fe5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions recaptcha/recaptcha.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
AfterViewInit,
Component,
EventEmitter,
HostBinding,
Input,
NgZone,
OnDestroy,
Expand All @@ -15,10 +16,12 @@ let nextId = 0;

@Component({
selector: 'recaptcha',
template: `<div [id]="id"></div>`,
template: ``,
})
export class RecaptchaComponent implements AfterViewInit, OnDestroy {
@Input() public id = `ngrecaptcha-${nextId++}`;
@Input()
@HostBinding('attr.id')
public id = `ngrecaptcha-${nextId++}`;

@Input() public siteKey: string;
@Input() public theme: ReCaptchaV2.Theme;
Expand Down

0 comments on commit b578fe5

Please sign in to comment.