![](/img/trans.png)
[英]Unable to create graphs using highcharts-ng in meanjs. how to create graphs from the existing table in MEANJS
[英]Allow skype calls from Angular App (using meanjs)
我无法摆脱影响我的应用程序功能的小问题,以便能够使用Skype拨打电话号码,到目前为止我所拥有的是:
HTML :
<a ng-href="skype:{{user.phone}}?call" class="btn btn-sm btn-success" type="button">{{user.phone}}</a>
ANGULAR
(function() {
angular.module('core').config(coreConfig);
coreConfig.$inject = ['$compileProvider'];
function coreConfig($compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|file|skype):/);
}
})();
结果总是一样的,当我悬停元素开始调用时,浏览器会显示: unsafe:skype:012345678?call
并且不允许我拨打号码...
我添加了配置部分浏览与类似问题相关的其他问题,但它没有解决我的问题。
编辑 :我正在使用meanjs.org
编辑2 :请不要复制/粘贴我的问题代码作为你的答案...我知道它适用于普通的Angular应用程序。 问题是我不能让它使用meanjs.org应用程序。 谢谢。
编辑3 :我刚刚发现:如果我在主根/
或子根中使用skype链接: /list
它可以正常工作而不添加unsafe
前缀。 在动态根目录中: /list/1234
它不再起作用。 我不知道它是否有帮助。
您需要使用正则表达式向Angular的白名单中明确添加URL协议。 默认情况下,仅启用http
, https
, ftp
和mailto
。 Angular将使用unsafe:
的非白名单URL作为前缀unsafe:
当使用chrome-extension:
等协议时chrome-extension:
。
将chrome-extension:
列入白名单的好地方chrome-extension:
协议将在您的模块的配置块中:
var app = angular.module( 'myApp', [] )
.config( [
'$compileProvider',
function( $compileProvider )
{
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension):/);
// Angular before v1.2 uses $compileProvider.urlSanitizationWhitelist(...)
}
]);
当您需要使用诸如file:
和tel:
协议时,同样的过程也适用。
有关详细信息,请参阅AngularJS $ compileProvider API文档 。
我已经让它成功地跟随了这个问题http://plnkr.co/edit/rIPFz9WhFjlRJ1ogCArP?p=preview
angular.module('plunker', [])
.config(function($compileProvider){
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|skype|mailto|tel|file):/)
})
.controller('MainCtrl', function($scope) {
$scope.href = 'skype:123456?call';
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.