After successfully establishing communication between the directive and controller, I am able to populate the embed code without any errors. However, the flash generated by the directive is not functioning at all, despite no visible discrepancies in the HTML structure compared to manually created embeds. Any insights or suggestions on why this might be happening would be greatly appreciated.
Below is a snapshot of how the site appears:
Here is the provided code snippet:
index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dist/css/bootstrap.css"/>
<link rel="stylesheet" href="dist/css/bootstrap-theme.css"/>
</head>
<body ng-app="App">
<div ng-controller="MainCtrl">
<div class="col-md-12">
<h2>This is from the Controller and Directive</h2>
Song[0] ID: {{Song[0].$id}}
<flash-widget id="Song"></flash-widget>
</div>
</div>
<div class="col-md-12">
<h2>This is done Manually</h2>
Song[0] ID: 4453334
<object width="250" height="40">
<embed src="http://grooveshark.com/songWidget.swf" type="application/x-shockwave-flash" width="250"height="40"flashvars="hostname=cowbell.grooveshark.com&songIDs=4453334&style=metal&p=0" allowscriptaccess="always" wmode="window"/>
</object>
</div>
</body>
<script src="dist/js/angular.js"></script>
<script src="js/tester.js"></script>
</body>
</html>
tester.js
angular.module("App", [])
.controller("MainCtrl", function($scope) {
$scope.Song=[{
"AlbumName":"Unknown Album",
"ArtistName":"Angel City",
"SongName":"Love Me Right Feat. Laura McAllen[Rezonance Q Remix]",
"$id":"4453334",
"$priority":null
},
{
"AlbumName":"Immersion",
"ArtistName":"Pendulum",
"SongName":"The Island - Part 1 - Dawn",
"$id":"26593443",
"$priority":null
},
{
"AlbumName":"Someone to Love Me",
"ArtistName":"Jomanda",
"SongName":"Got a Love for You",
"$id":"29376555",
"$priority":null
},
{
"AlbumName":"Avicii - Essential Mix (2010-12-11)",
"ArtistName":"Avicii",
"SongName":"Penguin",
"$id":"29533653",
"$priority":null
},
{
"AlbumName":"MOS Addicted To Bass 2011",
"ArtistName":"Eric Prydz",
"SongName":"Niton (The Reason)",
"$id":"30154682",
"$priority":null
}]
})
.directive('flashWidget', function(){
return{
restrict: 'E',
scope: {id: '='},
template: '<object width="250" height="40">'+
'<embed src="http://grooveshark.com/songWidget.swf" type="application/x-shockwave-flash" width="250" height="40" flashvars="hostname=cowbell.grooveshark.com&songIDs={{id[0].$id}}&style=metal&p=0" allowscriptaccess="always" wmode="window"></embed>'+
'</object>'
}
});