I'm inserting the src
atturbute for an <iframe>
using AngularJS.
For some reason though, whenever I call grab this value it is returned multiple times. I know this because I was checking using console.log(src)
to debug before I got the solution working.
This minor glitch doesn't seem to be causing any errors (or slowing my application down), but I'm curious to know what's happening?
Update
I have reduced the code in my controller by moving the bulk of the work to my custom recentStations
service (available if required).
The result within the HTML view is still the same, as is the behaviour of returning multiple results.
Controller
app.controller('contentCtrl', ['$scope', 'recentStations', function($scope, recentStations){
$scope.getCurrentSrc = function(){
return recentStations.getCurrentSrc();
};
}]);
HTML
<div id="content" data-ng-controller="contentCtrl">
<iframe data-ng-src="{{ getCurrentSrc() }}" seamless></iframe>
</div>