NG-HREF填充的Chrome扩展链接列表时, [英] ng-href when populating list of links in Chrome extension

查看:169
本文介绍了NG-HREF填充的Chrome扩展链接列表时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个Chrome扩展与角度,我尝试使用 NG-重复以创建一个链接列表。但我有填充的链接'问题的伟大工程的href 属性:

I'm working on a Chrome extension with Angular and I'm trying to use ng-repeat to create a list of links. Works great except I'm having issues populating the links' href attribute:

<ul>
    <li ng-repeat="item in menu" class="ng-scope">
        <a ng-href="#/new" href="unsafe:chrome-extension://ehklbggiaofbhgcghgnmejkpgommihdl/popup.html#/new">Add Link</a>
    </li>
    <li ng-repeat="item in menu" class="ng-scope">
        <a ng-href="#/bookmarks" href="unsafe:chrome-extension://ehklbggiaofbhgcghgnmejkpgommihdl/popup.html#/bookmarks">My Bookmarks</a>
    </li>
</ul>

我如何prevent的不安全:镀扩展的东西被插入?注:我有 NG-CSP 设置我的应用程序的根目录

How do I prevent the unsafe:chrome-extension stuff from being inserted? Note: I have ng-csp set on the root of my app.

推荐答案

我现在也面临着同样的问题。还没有找到任何解决办法。
请检查此链接:<一个href=\"https://groups.google.com/forum/?fromgroups=#!topic/angular/YiP02I1wkNU\">https://groups.google.com/forum/?fromgroups=#!topic/angular/YiP02I1wkNU.

I also face the same issue now. Have not found any solution. Please check this link: https://groups.google.com/forum/?fromgroups=#!topic/angular/YiP02I1wkNU.

按照此,请检查app.js <一个href=\"http://plnkr.co/edit/prTGFiheFI7GXNoDhoGT?p=$p$pview\">http://plnkr.co/edit/prTGFiheFI7GXNoDhoGT?p=$p$pview

Follow this, check the app.js on http://plnkr.co/edit/prTGFiheFI7GXNoDhoGT?p=preview

code,如:


  VAR应用= angular.module('angularjs起动器',[]);

var app = angular.module('angularjs-starter', []);

的app.config(函数($ compileProvider){
    $compileProvider.urlSanitizationWhitelist(/^\\s*(https?|ftp|mailto|file|chrome-extension):/);
  });
  

app.config(function($compileProvider){ $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|chrome-extension):/); });

这为我工作。

这篇关于NG-HREF填充的Chrome扩展链接列表时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆