Question

I basically want to use tel tag to make a phone call.

<a class="callButton" href="tel: {{phoneno}}"></a>

I am using $compileProvider to remove unsafe tag which comes by default, It works perfectly fine post 1.0.4v of angularjs. However below this version it doesnt work. Can anyone suggest how to implement this feature using angular version 1.0.4 or below?

Here is the sanitizing code which I am using in js file

app.config(['$compileProvider', function ($compileProvider) {
    $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel):/);
}

Assume I have already defined app variable.

P.S. This is an enhancement for particular app which basically works below 1.0.4v

Thanks

Was it helpful?

Solution

Add this to your scripts after angular is loaded.

I asume your on 1.1.5, but change to whatever you need the version to be. http://code.angularjs.org/1.1.5/angular-sanitize.min.js

Example:

sanitizeSomething = function(string) {
    return $sanitize(string);
};

sanitizedString = sanitizeSomething(string);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top