The following code is also available in the dojo at http://dojo.telerik.com/@larkydoo/OGeYi. What I need to be able to do is to iterate through my Authors list within the template. I've tried a few variations without any luck. Help?
Thanks!
Here's the code:
<!DOCTYPE html>
<html>
<head>
<style>html { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }</style>
<title></title>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.429/styles/kendo.common.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.429/styles/kendo.default.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.429/styles/kendo.dataviz.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.429/styles/kendo.dataviz.default.min.css" />
<script src="http://cdn.kendostatic.com/2015.1.429/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2015.1.429/js/angular.min.js"></script>
<script src="http://cdn.kendostatic.com/2015.1.429/js/kendo.all.min.js"></script>
</head>
<body>
<script src="../content/shared/js/products.js"></script>
<div id="example" ng-app="KendoDemos">
<div ng-controller="MyCtrl">
<div class="demo-section">
<div kendo-list-view id="listView" k-data-source="source">
<div class="product" k-template>
<h3>#:Title#</h3>
<p>#:Publisher#</p>
<p>#:AuthorsList#</p>
<div ng-repeat="author in #=Authors#">Display FullName Here: {{FullName}}</div>
</div>
</div>
</div>
</div>
</div>
<script>
angular.module("KendoDemos", [ "kendo.directives" ])
.controller("MyCtrl", function($scope){
$scope.source = new kendo.data.DataSource({
data: [
{
"$id": "1",
"ResourceId": 720,
"Title": "Volleyed and Thundered: A Short, Brutal History of War",
"AuthorsList": "Alfred Lloyd Tennyson",
"Publisher": "University of Hard Knocks",
"Authors": [
{
"$id": "2",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Alfred Lloyd Tennyson",
"IsApproved": false,
"FriendlyPath": "alfred_lloyd_tennyson"
}
]
},
{
"$id": "3",
"ResourceId": 867,
"Title": "Explorations in Imagination",
"AuthorsList": "Vladimir Nabokov, Robert Frost, Virginia Woolf, Ursula LeGuin, and Philip K. Dick",
"Publisher": "University of the Universe",
"Authors": [
{
"$id": "4",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Vladimir Nabokov",
"IsApproved": false,
"FriendlyPath": "vladimir_nabokov"
},
{
"$id": "5",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Robert Frost",
"IsApproved": false,
"FriendlyPath": "robert_frost"
},
{
"$id": "6",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Virginia Woolf",
"IsApproved": false,
"FriendlyPath": "virginia_woolf"
},
{
"$id": "7",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Ursula LeGuin",
"IsApproved": false,
"FriendlyPath": "ursula_leguin"
},
{
"$id": "8",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Philip K. Dick",
"IsApproved": false,
"FriendlyPath": "philip_k_dick"
}
]
},
{
"$id": "9",
"ResourceId": 1031,
"Title": "Stories from Everywhere",
"AuthorsList": "Tobias Wolfe, George Orwell, Ray Bradbury, Doctor Seuss, and Wallace Stevens",
"Publisher": "All Around U",
"Authors": [
{
"$id": "10",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Tobias Wolfe",
"IsApproved": false,
"FriendlyPath": "tobias_wolfe"
},
{
"$id": "11",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "George Orwell",
"IsApproved": false,
"FriendlyPath": "george_orwell"
},
{
"$id": "12",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Ray Bradbury",
"IsApproved": false,
"FriendlyPath": "ray_bradbury"
},
{
"$id": "13",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Doctor Seuss",
"IsApproved": false,
"FriendlyPath": "doctor_seuss"
},
{
"$id": "14",
"AuthorId": 0,
"ResourceId": 0,
"FullName": "Wallace Stevens",
"IsApproved": false,
"FriendlyPath": "wallace_stevens"
}
]
}
]
});
$scope.onClick = function(e) {
alert(1);
}
})
</script>
</body>
</html>