使用文本角度嵌入音频



我想使用 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。但即便如此,它也没有正确呈现它。当我按下工具栏按钮时,它正在插入。但是当我尝试保存文件时,它只是省略了音频标签及其所有属性。请帮助我

我添加了音频标签来净化角度.js它解决了我的问题。

最新更新