[Representation] Add template tester

...to simply verification of mct-include/mct-representation
behavior.
This commit is contained in:
Victor Woeltjen 2015-10-28 16:01:55 -07:00
parent c5fcc5a558
commit 5604bf6d69
3 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,17 @@
{
"extensions": {
"routes": [
{
"when": "/templates",
"templateUrl": "templates.html"
}
],
"controllers": [
{
"implementation": "TemplateTestingController.js",
"key": "TTC",
"depends": [ "$scope", "objectService" ]
}
]
}
}

View File

@ -0,0 +1,14 @@
<div ng-controller="TTC">
<div style="border: 5px white solid">
<div>mct-include</div>
<input type="text" ng-model="ikey">
<mct-include key="ikey"></mct-include>
</div>
<div style="border: 5px pink solid">
<div>mct-representation</div>
<input type="text" ng-model="rkey">
<input type="text" ng-model="rid">
<mct-representation key="rkey" mct-object="obj"></mct-representation>
</div>
</div>

View File

@ -0,0 +1,18 @@
/*global define*/
define([], function () {
'use strict';
return function TemplateTestingController($scope, objectService) {
$scope.ikey = '';
$scope.rkey = '';
$scope.rid = '';
$scope.obj = undefined;
$scope.$watch('rid', function (id) {
$scope.obj = undefined;
objectService.getObjects([id]).then(function (objs) {
$scope.obj = objs[id];
});
});
};
});