xmaestro/angular2-recaptcha

ERROR TypeError: Cannot read property 'nativeElement' of undefined on second time route to the page

arahmancsd opened this issue · 0 comments

I am using this control in my angular ionic app. I am following the guideline to load and implement the plugin. The control loads correctly for this first time or in other ways when you route to the page for the first time it works and loads as expected. However, when you **re-route for the second time the control doesn't load and I am getting the error in the subject with the following details.

ERROR TypeError: Cannot read property 'nativeElement' of undefined
at SafeSubscriber._next (captcha.component.js:35)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:183)
at SafeSubscriber.next (Subscriber.js:122)
at Subscriber._next (Subscriber.js:72)
at Subscriber.next (Subscriber.js:49)
at BehaviorSubject._subscribe (BehaviorSubject.js:14)
at BehaviorSubject._trySubscribe (Observable.js:42)
at BehaviorSubject._trySubscribe (Subject.js:81)
at BehaviorSubject.subscribe (Observable.js:28)
at Observable._subscribe (Observable.js:76)

The implmentation is straighforward from the repository, so not necesary to paste the same code.