Javascript 修改嵌入的角度指令

Javascript 修改嵌入的角度指令,javascript,angularjs,embed,firebase,Javascript,Angularjs,Embed,Firebase,我正在尝试使用Angular指令修改嵌入的对象。我很难让指令生效 这是目标代码 <object width="250" height="40"> <param name="movie" value="http://grooveshark.com/songWidget.swf"> <param name="wmode" value="window"> <param name="allowScriptAccess" value="al

我正在尝试使用Angular指令修改嵌入的对象。我很难让指令生效

这是目标代码

<object width="250" height="40">
    <param name="movie" value="http://grooveshark.com/songWidget.swf">
    <param name="wmode" value="window">
    <param name="allowScriptAccess" value="always">
    <param name="flashvars" value="hostname=cowbell.grooveshark.com&amp;songIDs=26593443&amp;style=metal&amp;p=0">
    <embed src="http://grooveshark.com/songWidget.swf" type="application/x-shockwave-flash" width="250"height="40"flashvars="hostname=cowbell.grooveshark.com&amp;songIDs=26593443&amp;style=metal&amp;p=0" allowscriptaccess="always" wmode="window"/>
</object>
app.js

angular.module("GrooveApp", ["firebase"])
    .controller("MainCtrl", function($scope, $firebase) {
        var ref = new Firebase("/bpm_playlist");
        var sync = $firebase(ref);
        // create a synchronized array for use in our HTML code
        $scope.bpmSong = sync.$asArray();
    })
    .directive('flashWidget', function(){

        return {
            restrict: 'E',
            scope: {
                width:'=',
                height:'=',
                src: '=',
                songID: '='
            },
            template: '<object width="250" height="40">'+
            '<param name="movie" value="http://grooveshark.com/songWidget.swf">'+
                '<param name="wmode" value="window">'+
            '<param name="allowScriptAccess" value="always">'+
                '<param name="flashvars"value="hostname=cowbell.grooveshark.com&amp;songIDs="{{songId}}"&amp;style=metal&amp;p=0">'+
            '<embed src="http://grooveshark.com/songWidget.swf" type="application/x-shockwave-flash"width="250"height="40"flashvars="hostname=cowbell.grooveshark.com&amp;songIDs="{{songId}}"&amp;style=metal&amp;p=0" allowscriptaccess="always" wmode="window"/>'+
                '</object>'
        }
    });
angular.module(“GrooveApp”,[“firebase”])
.controller(“MainCtrl”,函数($scope,$firebase){
var ref=新Firebase(“/bpm_播放列表”);
var sync=$firebase(ref);
//创建一个在HTML代码中使用的同步数组
$scope.bpmSong=sync.$asArray();
})
.directive('flashWidget',function(){
返回{
限制:'E',
范围:{
宽度:'=',
高度:“=”,
src:“=”,
songID:“=”
},
模板:“”+
''+
''+
''+
''+
''+
''
}
});

尝试下面这样的指令,这是未经测试的

.directive('flashWidget', function(){

return {
    restrict: 'E',
    scope: {
        width:'=',
        height:'=',
        src: '=',
        songID: '='
    },
    template: '<object width="{{width}}" height="{{height}}">'+
                '<param name="movie" value="{{src}}">'+
                '<param name="wmode" value="window">'+
                '<param name="allowScriptAccess" value="always">'+
                '<param name="flashvars"value="hostname=cowbell.grooveshark.com&amp;songIDs="{{songId}}"&amp;style=metal&amp;p=0">'+
                '<embed src="{{src}}" type="application/x-shockwave-flash"width="{{width}}"height="{{height}}"flashvars="hostname=cowbell.grooveshark.com&amp;songIDs="{{songId}}"&amp;style=metal&amp;p=0" allowscriptaccess="always" wmode="window"/>'+
            '</object>'
    }
})
指令('flashWidget',函数(){ 返回{ 限制:'E', 范围:{ 宽度:'=', 高度:“=”, src:“=”, songID:“=” }, 模板:“”+ ''+ ''+ ''+ ''+ ''+ '' } }) 然后将数据传递到视图中的指令中:

<flash-widget width='250' height='40' src='http://grooveshark.com/songWidget.swf' songID='{{bpmSong[0].$id}}' ></flash>


这不起作用,但我想这就是我要找的。我正在用更多的代码更新我的问题,以便您可以看到我在做什么。错误:未捕获的语法错误:模板行关闭时出现意外字符串!错误:语法错误:Token“:”是表达式第5列的意外标记。如果不查看完整代码,我将无能为力。阅读Dan Wahlin的指令指南好的,我来看看指南。这是我的全部代码我唯一没有添加的是一个角度常数和我完整的firebase URL你忘了在
模板:
中用
+
连接字符串,我做了,我移动了src,我不再得到语法错误,但flash播放器说没有歌曲
.directive('flashWidget', function(){

return {
    restrict: 'E',
    scope: {
        width:'=',
        height:'=',
        src: '=',
        songID: '='
    },
    template: '<object width="{{width}}" height="{{height}}">'+
                '<param name="movie" value="{{src}}">'+
                '<param name="wmode" value="window">'+
                '<param name="allowScriptAccess" value="always">'+
                '<param name="flashvars"value="hostname=cowbell.grooveshark.com&amp;songIDs="{{songId}}"&amp;style=metal&amp;p=0">'+
                '<embed src="{{src}}" type="application/x-shockwave-flash"width="{{width}}"height="{{height}}"flashvars="hostname=cowbell.grooveshark.com&amp;songIDs="{{songId}}"&amp;style=metal&amp;p=0" allowscriptaccess="always" wmode="window"/>'+
            '</object>'
    }
})
<flash-widget width='250' height='40' src='http://grooveshark.com/songWidget.swf' songID='{{bpmSong[0].$id}}' ></flash>