mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 12:48:14 +00:00
[Core] Spec for domain objects
Spec for DomainObject and DomainObjectProvider; part of ongoing test coverage for transition of platform/core bundle, WTD-573.
This commit is contained in:
@ -16,9 +16,10 @@ define(
|
||||
* @param {CapabilityService} capabilityService the service
|
||||
* which provides capabilities (dynamic behavior)
|
||||
* for domain objects.
|
||||
* @param $q Angular's $q, for promise consolidation
|
||||
* @constructor
|
||||
*/
|
||||
function DomainObjectProvider(modelService, capabilityService) {
|
||||
function DomainObjectProvider(modelService, capabilityService, $q) {
|
||||
// Given a models object (containing key-value id-model pairs)
|
||||
// create a function that will look up from the capability
|
||||
// service based on id; for handy mapping below.
|
||||
@ -54,7 +55,7 @@ define(
|
||||
// domain object provider.
|
||||
function getObjects(ids) {
|
||||
return modelService.getModels(ids).then(function (models) {
|
||||
return Promise.all(
|
||||
return $q.all(
|
||||
ids.map(capabilityResolver(models))
|
||||
).then(function (capabilities) {
|
||||
return assembleResult(ids, models, capabilities);
|
||||
|
Reference in New Issue
Block a user