Hi,
I would like to extend the string functions. Therefore i created the following structure:
-src
-app
- extensions
-string.ts
My string.ts files contains the following
String.prototype.isValidEmail = function() {
var re= /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(this);
};
interface String {
isValidEmail(): boolean;
}
If i now use this function i get this error : this.email.isValidEmail is not a function, most likely because does not include it in the build process. My question is where should i include this, so this function would be recognized?