Skip to content

Instantly share code, notes, and snippets.

@EdCharbeneau
Last active November 28, 2016 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdCharbeneau/073d5dd8e2644e43b5371c121cf12dc7 to your computer and use it in GitHub Desktop.
Save EdCharbeneau/073d5dd8e2644e43b5371c121cf12dc7 to your computer and use it in GitHub Desktop.
Sample data for the Kendo UI for Angular 2 Sortable demo
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'Sortable Demo';
groups = [];
ungroupedContacts = [];
constructor() {
this.groups = this.getContacts()
.filter(c => c.group != "Ungrouped");
this.ungroupedContacts = this.getContacts()
.filter(c => c.group == "Ungrouped")[0].people;
}
private getContacts() {
return [
{
group: "Friends",
people: [
{
id: 6,
name: "Todd Motto",
location: "London"
},
{
id: 9,
name: "Ed Charbeneau",
location: "Louisville"
}
]
},
{
group: "Teams",
people: [
{
id: 3,
name: "Mary Jane",
location: "Sofia"
},
{
id: 4,
name: "Linda Belcher",
location: "Orlando"
}
]
},
{
group: "Ungrouped",
people: [
{
id: 1,
name: "Sarah Smith",
location: "New York"
},
{
id: 2,
name: "Ron Burgundy",
location: "Boston"
},
{
id: 5,
name: "Morty Smith",
location: "Boston"
},
{
id: 7,
name: "Rick Sanchez",
location: "Boston"
}
]
}
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment