mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 06:03:08 +00:00
[Representation] Add template tester
...to simply verification of mct-include/mct-representation behavior.
This commit is contained in:
parent
c5fcc5a558
commit
5604bf6d69
17
example/templates/bundle.json
Normal file
17
example/templates/bundle.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"extensions": {
|
||||
"routes": [
|
||||
{
|
||||
"when": "/templates",
|
||||
"templateUrl": "templates.html"
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
{
|
||||
"implementation": "TemplateTestingController.js",
|
||||
"key": "TTC",
|
||||
"depends": [ "$scope", "objectService" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
14
example/templates/res/templates.html
Normal file
14
example/templates/res/templates.html
Normal 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>
|
18
example/templates/src/TemplateTestingController.js
Normal file
18
example/templates/src/TemplateTestingController.js
Normal 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];
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
Loading…
Reference in New Issue
Block a user