I'm new to web dev. I'm using AngularJS 1.3.0. When I try using {{ things[0].embed }} to insert the embedded source video link from my database, nothing is displayed, but hardcoding the link, for example "//www.youtube.com/embed/wZZ7oFKsKzY", works. Is there something that I'm missing? Am I misusing the scope somehow? Here's another example of what I'm trying to do. If you replace the {{thing[0].embed}} with the youtube link, it works. Why doesn't it replace the {{thing[0].embed}} with the link? http://plnkr.co/edit/Udml7NIyWcUuMtYGDXNc?p=preview
//myCore.js
var coreControl = angular.module('myCore', []);
function mainController($scope, $http) {
$scope.formData = {};
$http.get('*')
.success(function(data) {
$scope.things = data;
console.log(data);
})
.error(function(data) {
console.log('Error: ' + data);
});
$scope.doThings = function() {
$http.post('*', $scope.formData)
.success(function(data) {
$scope.formData = {};
$scope.things = data;
console.log(data);
})
.error(function(data) {
console.log('Error: ' + data);
});
};
}
//index.html
<div ng-if="moves.length==1" class="col-sm-4 col-sm-offset-4">
<h1> {{ things[0].name }} </h1>
<iframe width="560" height="315" ng-src="{{ things[0].embed }}" frameborder="0" allowfullscreen></iframe>
{{ things[0].embed }}
</div>