I am attempting to pass down attributes returned from a MongoDB query to a directive in Angular, but for some reason it will not pass down an "_id" attribute. When I view the records returned in the parent's $scope, I can see that each object does in fact have an "_id". However when I go to inspect the $scope of the directive I am attempting to render, I can see that it has every attribute besides "_id".
My parent template code:
<div id=cards>
<div ng-repeat='card in cards' class='card'>
<card-directive
_id={{card._id}} attack={{card.attack}} cost={{card.cost}}
health={{card.health}} img={{card.img}} name={{card.name}}
hero={{hero}} rarity={{card.rarity}} type={{card.type}}
class={{hero}} add={{add}} faction={{card.faction}} >
</card-directive>
</div>
</div>
My directive code:
function cardDirective() {
return {
restrict: 'E',
scope: {
'_id': '@',
'img': '@',
'attack': '@',
'cost': '@',
'health': '@',
'name': '@',
'rarity': '@',
'type': '@',
'hero': '@',
'add': '@',
'faction': '@'
},
Is there something special about including an attribute that begins with an underscore?