Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to use other variables and functions in verify method #21

Open
kajalbh99 opened this issue Aug 1, 2018 · 2 comments
Open

unable to use other variables and functions in verify method #21

kajalbh99 opened this issue Aug 1, 2018 · 2 comments

Comments

@kajalbh99
Copy link

verifyTag(str: string): boolean{ **this.taggedUser(str);** return str !== 'ABC' && str.trim() !== ''; }

@thelebdev
Copy link

Can you please further explain your issue?

@chetanbansal019
Copy link

I am facing the same issue.. the exact issue is that inside the verifyTag method, we cannot access any other class property or method, which are defined outside its scope.
verifyTag(str: string): boolean{
var patt = /^[0-9]{10,12}$/;
var validity = patt.test(str);
if(validity){
this.testValildate.emailError = false }
else{
this.testValildate.emailError = true
}
return validity;
}

Here, this.testValildate is undefined.

Any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants