Backbone tests added

This commit is contained in:
Boris Yankov
2012-10-22 10:44:05 +03:00
parent 0073b1025f
commit d080110f98
+20 -1
View File
@@ -67,4 +67,23 @@ note.get("title")
note.set({title: "March 20", content: "In his eyes she eclipses..."});
note.set("title", "A Scandal in Bohemia");
note.set("title", "A Scandal in Bohemia");
//////////
class Employee extends Backbone.Model {
reports: EmployeeCollection;
constructor (options? ) {
super(options);
this.reports = new EmployeeCollection();
this.reports.url = '../api/employees/' + this.id + '/reports';
}
}
class EmployeeCollection extends Backbone.Collection {
url: string = "../api/employees";
model = Employee;
findByName(key) {}
}