Last active
November 28, 2016 20:26
-
-
Save EdCharbeneau/073d5dd8e2644e43b5371c121cf12dc7 to your computer and use it in GitHub Desktop.
Sample data for the Kendo UI for Angular 2 Sortable demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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