Database Reference
In-Depth Information
$http.get('/structr/rest/tasks').
success(function(data, status, headers,
config) {
scrollItems =
data.result.map(function(task) {
return task.name;
});
$scope.scrollItems = scrollItems;
}).
error(function(data, status, headers,
config) {
[...]
});
Listing 2.5:
Ausschnitt aus demo.js
Als Nächstes erweitern wir das Datenmodell (
Abb. 2.5
) um die Klasse
Invoice
mit den At-
tributen
amount
,
customer
,
date
,
mailingAddress
und
paid
(
Abb. 2.6
). Dabei ist das lokale
Attribut
customer
ein so genanntes
Notion
-Attribut, das das
name
-Attribut der verbunde-
nen Klasse
Customer
kapselt und über das
auto-create
-Flag die Erzeugung einer
Custo-
mer
-Instanz auslöst (
Abb. 2.7
).
Search WWH ::
Custom Search