1

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

2
  • Did you try using the sanitize plugin for angularjs? Commented Sep 25, 2013 at 8:44
  • I just did that and it works. thanks Commented Sep 26, 2013 at 5:32

1 Answer 1

3

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);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.