-
Notifications
You must be signed in to change notification settings - Fork 137
Closed
Description
Hi,
I have a special use-case, where multiple belongsTo are needed.
In our data-model, where we don't know the hierarchy-depth of nested elements in advance, so we use a 'general' entity, that is nested in 'itself'. We have an additional 'type' entity, defining the nodes special attributes, like this:
name: 'Entity',
endpoint: 'entities.json',
relations:
{
belongsTo:
{
Entity:
{
localField: 'parent',
localKey: 'parentId',
parent: false
},
EntityType:
{
localField: 'type',
localKey: 'typeId'
}
},
hasMany:
{
Entity:
{
localField: 'children',
foreignKey: 'parentId'
}
}I didn't find a clue in the docs this wouldn't work, but unfortunately it doesn't seem to do so.
It produces an error:
Entity RuntimeError Object
37.defaultsPrototype.error
37.defaultsPrototype.errorFn
_inject
_inject
inject
(anonymous function)
processResults
(anonymous function)
deferred.promise.then.wrappedCallback
(anonymous function)
$get.Scope.$eval
$get.Scope.$digest
$get.Scope.$apply
done
completeRequest
xhr.onreadystatechange
Entity RuntimeError Object
37.defaultsPrototype.error
37.defaultsPrototype.errorFn
_inject
_inject
inject
(anonymous function)
processResults
(anonymous function)
deferred.promise.then.wrappedCallback
(anonymous function)
$get.Scope.$eval
$get.Scope.$digest
$get.Scope.$apply
done
completeRequest
xhr.onreadystatechange
Entity RuntimeError Object
37.defaultsPrototype.error
37.defaultsPrototype.errorFn
_inject
_inject
inject
(anonymous function)
processResults
(anonymous function)
deferred.promise.then.wrappedCallback
(anonymous function)
$get.Scope.$eval
$get.Scope.$digest
$get.Scope.$apply
done
completeRequest
xhr.onreadystatechange
TypeError: Cannot read property 'id' of undefined