[Views] Repair view registry for mainViews (#1308)

* [Views] Rewrite mct-view

...to make it a simple way to include non-Angular views, without
integrating unnecessarily with other architectural concerns.
Supports restoration of view registration functionality to fix
#1307

* [API] Use identifier as property name

* [API] Add adapter capability

...to simplify adapter layer (allowing new-style objects to be
retrieved via capability.)

* [API] Add AdaptedViewController

* [API] Add template for adapted views

* [API] Add AdaptedViewPolicy

* [API] Wire in view adapter

* [API] Fix adapter capability implementation

* [API] Don't create new scope from mct-view

...to allow use on same element as ng-controller (and because a
new scope just is not necessary.)
This commit is contained in:
Victor Woeltjen
2016-11-03 10:37:58 -07:00
committed by Pete Richards
parent 025b69541e
commit 547696d797
7 changed files with 181 additions and 56 deletions

View File

@ -78,7 +78,7 @@ define([
// Converts composition to use key strings instead of keys
var toOldFormat = function (model) {
model = JSON.parse(JSON.stringify(model));
delete model.key;
delete model.identifier;
if (model.composition) {
model.composition = model.composition.map(makeKeyString);
}
@ -86,9 +86,9 @@ define([
};
// converts composition to use keys instead of key strings
var toNewFormat = function (model, key) {
var toNewFormat = function (model, identifier) {
model = JSON.parse(JSON.stringify(model));
model.key = key;
model.identifier = parseKeyString(identifier);
if (model.composition) {
model.composition = model.composition.map(parseKeyString);
}