javascript - 使用文本 Angular 嵌入音频

标签 javascript jquery angularjs html audio

我想使用 textAngular 工具栏嵌入音频文件。这是我用于此目的的代码。

userapp.config(function($provide){
$provide.decorator('taOptions', ['testFactory', 'taRegisterTool', '$delegate', function(tFact, taRegisterTool, taOptions){
    console.log(taOptions);
    taRegisterTool('insertaudio', {
        iconclass: "fa fa-file-audio-o",
        buttontitle: 'Insert Image From Local Mechine or URL',
        action: function($deferred){
            this.$editor().wrapSelection('inserthtml','<audio controls="controls" SRC="http://olremix.org/mp3/Brunzolaitis_-_A_Link_To_OLR(Legend_of_Zelda_A_Link_to_the_Past).mp3"></audio>');
             $deferred.resolve();
        }
    });
    taOptions.toolbar[1].push('insertaudio');
    return taOptions;
}]);

});

但问题是,每当我尝试保存它时,它都会忽略音频标签。我尝试了 taApplyCustomRenderers。但即便如此,它也无法正确渲染。当我按下工具栏按钮时它正在插入。但是当我尝试保存文件时,它只是忽略了音频标签及其所有属性。请帮助我

最佳答案

我向 angular-sanitize.js 添加了音频标签,它解决了我的问题。

关于javascript - 使用文本 Angular 嵌入音频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27484612/

相关文章:

java - 是否可以在 ie 中从 JavaScript 创建任意 Java 对象?

javascript - rows.forEach 不是一个函数

javascript - ionic 输入不起作用但输入有效

javascript - AngularJS : Q deferreds and requestFileSystem

javascript - 拒绝从 '*' 执行脚本,因为它的 MIME 类型 ('application/json' ) 不可执行,并且严格的 MIME 类型 che

javascript - 如何知道 document.ready 还剩多少时间/%?

javascript 图像翻转

另一个 Bootstrap 模式中可用的 Javascript 函数

javascript - 如何在 karma + jasmine 中测试我的 Angular 作用域函数?

javascript - 当我的所有 Ng-from 都有效时启用一键