I am new to Angular and probably missing something obvious, but I have the following custom filter:
propertyApp.filter('telLink', function() {
return function(tel) {
if(typeof(tel) != undefined) {
if(tel.charAt(0) === '0') {
tel = tel.substr(1);
}
tel = "44" + tel;
return tel.replace(" ", "");
}
}
});
When I use this in a view, I get the following:
Can't interpolate: tel:{{property.agent_phone | telLink}}
TypeError: Cannot call method 'charAt' of undefined
Can someone point me in the right direction? Thanks in advance.
source
share