From d080110f983183fd4eb52b506d9eefe6db35399f Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Mon, 22 Oct 2012 10:44:05 +0300 Subject: [PATCH] Backbone tests added --- Tests/backbone-tests.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Tests/backbone-tests.ts b/Tests/backbone-tests.ts index e3c8cd42b..f66f6de44 100644 --- a/Tests/backbone-tests.ts +++ b/Tests/backbone-tests.ts @@ -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"); \ No newline at end of file +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) {} +} \ No newline at end of file