私のスキーマは次のようになります。
super.js:
var superSchema = new Schema({
title: {
type: String,
default: '',
trim: true
},
item: [{
type: Schema.ObjectId,
ref: 'Item'
}]
});
item.js:
var itemSchema = new Schema({
name: {
type: String,
default: '',
trim: true
}
});
私のjsonは次のようになります。
[{
"title": "Team 1",
"items": [
"52c23f2129sdf1720d000006",
"52c23f2129asd1720d000006",
"52c23f212992cfdsd00000f6"]
},{
"title": "Team 2",
"items": [
"52c23f2129sdf1720d000006",
"52c23f2129asd1720d000006",
"52c23f212992cfdsd00000f6"]
}]
次に、item[0].name
このようにlist.htmlファイルにアクセスしようとしましたが、{{item[0].name}}
何も返されず、item [0]がIDを返します。
angular htmlファイルのitem [0] .nameにアクセスするにはどうすればよいですか?
私のsuperDuperController.js :
$scope.find = function() {
SuperDuper.query(function(superDuper) {
$scope.superDuper = superDuper;
});
};