mirror of
https://github.com/nasa/openmct.git
synced 2025-05-29 13:44:21 +00:00
[Tutorials] #907 Updated tutorials to use new bundle registration mechanism
This commit is contained in:
parent
70a13a75d5
commit
5eff4e45c9
@ -363,11 +363,11 @@ define([
|
|||||||
+ {
|
+ {
|
||||||
+ "key": "example.todo",
|
+ "key": "example.todo",
|
||||||
+ "name": "To-Do List",
|
+ "name": "To-Do List",
|
||||||
+ "glyph": "j",
|
+ "glyph": "2",
|
||||||
+ "description": "A list of things that need to be done.",
|
+ "description": "A list of things that need to be done.",
|
||||||
+ "features": ["creation"]
|
+ "features": ["creation"]
|
||||||
+ }
|
+ }
|
||||||
}
|
+ ]}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -460,7 +460,7 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"name": "To-Do List",
|
"name": "To-Do List",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"description": "A list of things that need to be done.",
|
"description": "A list of things that need to be done.",
|
||||||
"features": ["creation"]
|
"features": ["creation"]
|
||||||
}
|
}
|
||||||
@ -469,9 +469,10 @@ define([
|
|||||||
+ {
|
+ {
|
||||||
+ "key": "example.todo",
|
+ "key": "example.todo",
|
||||||
+ "type": "example.todo",
|
+ "type": "example.todo",
|
||||||
+ "glyph": "j",
|
+ "glyph": "2",
|
||||||
+ "name": "List",
|
+ "name": "List",
|
||||||
+ "templateUrl": "templates/todo.html"
|
+ "templateUrl": "templates/todo.html",
|
||||||
|
+ "editable": true
|
||||||
+ }
|
+ }
|
||||||
+ ]
|
+ ]
|
||||||
}
|
}
|
||||||
@ -516,7 +517,7 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"name": "To-Do List",
|
"name": "To-Do List",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"description": "A list of things that need to be done.",
|
"description": "A list of things that need to be done.",
|
||||||
"features": ["creation"],
|
"features": ["creation"],
|
||||||
+ "model": {
|
+ "model": {
|
||||||
@ -531,9 +532,10 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"type": "example.todo",
|
"type": "example.todo",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"templateUrl": "templates/todo.html"
|
"templateUrl": "templates/todo.html",
|
||||||
|
"editable": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -675,7 +677,7 @@ it in our bundle definition, as an extension of category `controllers`:
|
|||||||
```diff
|
```diff
|
||||||
define([
|
define([
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
'./controllers/TodoController'
|
'./src/controllers/TodoController'
|
||||||
], function (
|
], function (
|
||||||
legacyRegistry,
|
legacyRegistry,
|
||||||
TodoController
|
TodoController
|
||||||
@ -688,7 +690,7 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"name": "To-Do List",
|
"name": "To-Do List",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"description": "A list of things that need to be done.",
|
"description": "A list of things that need to be done.",
|
||||||
"features": ["creation"],
|
"features": ["creation"],
|
||||||
"model": {
|
"model": {
|
||||||
@ -703,9 +705,10 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"type": "example.todo",
|
"type": "example.todo",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"templateUrl": "templates/todo.html"
|
"templateUrl": "templates/todo.html",
|
||||||
|
"editable": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
+ "controllers": [
|
+ "controllers": [
|
||||||
@ -768,7 +771,7 @@ extension definition.
|
|||||||
```diff
|
```diff
|
||||||
define([
|
define([
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
'./controllers/TodoController'
|
'./src/controllers/TodoController'
|
||||||
], function (
|
], function (
|
||||||
legacyRegistry,
|
legacyRegistry,
|
||||||
TodoController
|
TodoController
|
||||||
@ -781,7 +784,7 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"name": "To-Do List",
|
"name": "To-Do List",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"description": "A list of things that need to be done.",
|
"description": "A list of things that need to be done.",
|
||||||
"features": ["creation"],
|
"features": ["creation"],
|
||||||
"model": {
|
"model": {
|
||||||
@ -796,9 +799,10 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"type": "example.todo",
|
"type": "example.todo",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"templateUrl": "templates/todo.html",
|
"templateUrl": "templates/todo.html",
|
||||||
|
"editable": true,
|
||||||
+ "toolbar": {
|
+ "toolbar": {
|
||||||
+ "sections": [
|
+ "sections": [
|
||||||
+ {
|
+ {
|
||||||
@ -995,7 +999,7 @@ declare that dependency in its extension definition:
|
|||||||
```diff
|
```diff
|
||||||
define([
|
define([
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
'./controllers/TodoController'
|
'./src/controllers/TodoController'
|
||||||
], function (
|
], function (
|
||||||
legacyRegistry,
|
legacyRegistry,
|
||||||
TodoController
|
TodoController
|
||||||
@ -1008,7 +1012,7 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"name": "To-Do List",
|
"name": "To-Do List",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"description": "A list of things that need to be done.",
|
"description": "A list of things that need to be done.",
|
||||||
"features": ["creation"],
|
"features": ["creation"],
|
||||||
"model": {
|
"model": {
|
||||||
@ -1023,9 +1027,10 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"type": "example.todo",
|
"type": "example.todo",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"templateUrl": "templates/todo.html",
|
"templateUrl": "templates/todo.html",
|
||||||
|
"editable": true,
|
||||||
"toolbar": {
|
"toolbar": {
|
||||||
"sections": [
|
"sections": [
|
||||||
{
|
{
|
||||||
@ -1259,7 +1264,7 @@ declare it in our bundle definition, this time as an extension of category
|
|||||||
```diff
|
```diff
|
||||||
define([
|
define([
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
'./controllers/TodoController'
|
'./src/controllers/TodoController'
|
||||||
], function (
|
], function (
|
||||||
legacyRegistry,
|
legacyRegistry,
|
||||||
TodoController
|
TodoController
|
||||||
@ -1272,7 +1277,7 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"name": "To-Do List",
|
"name": "To-Do List",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"description": "A list of things that need to be done.",
|
"description": "A list of things that need to be done.",
|
||||||
"features": ["creation"],
|
"features": ["creation"],
|
||||||
"model": {
|
"model": {
|
||||||
@ -1284,9 +1289,10 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
"type": "example.todo",
|
"type": "example.todo",
|
||||||
"glyph": "j",
|
"glyph": "2",
|
||||||
"name": "List",
|
"name": "List",
|
||||||
"templateUrl": "templates/todo.html",
|
"templateUrl": "templates/todo.html",
|
||||||
|
"editable": true,
|
||||||
"toolbar": {
|
"toolbar": {
|
||||||
"sections": [
|
"sections": [
|
||||||
{
|
{
|
||||||
@ -1334,6 +1340,7 @@ Note that we've also removed our placeholder tasks from the `model` of the
|
|||||||
To-Do List's type above; now To-Do Lists will start off empty.
|
To-Do List's type above; now To-Do Lists will start off empty.
|
||||||
|
|
||||||
Finally, let's utilize these changes from our view's template:
|
Finally, let's utilize these changes from our view's template:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
+ <div ng-controller="TodoController" class="example-todo">
|
+ <div ng-controller="TodoController" class="example-todo">
|
||||||
+ <div class="example-button-group">
|
+ <div class="example-button-group">
|
||||||
@ -1641,7 +1648,7 @@ telemetry objects in view, as well as the width for each bar.
|
|||||||
|
|
||||||
We will also utilize this from our template:
|
We will also utilize this from our template:
|
||||||
```diff
|
```diff
|
||||||
<div class="example-bargraph">
|
+ <div class="example-bargraph" ng-controller="BarGraphController">
|
||||||
<div class="example-tick-labels">
|
<div class="example-tick-labels">
|
||||||
+ <div ng-repeat="value in [low, middle, high] track by $index"
|
+ <div ng-repeat="value in [low, middle, high] track by $index"
|
||||||
+ class="example-tick-label"
|
+ class="example-tick-label"
|
||||||
@ -1696,7 +1703,7 @@ service we made use of.
|
|||||||
```diff
|
```diff
|
||||||
define([
|
define([
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
'./controllers/BarGraphController'
|
'./src/controllers/BarGraphController'
|
||||||
], function (
|
], function (
|
||||||
legacyRegistry,
|
legacyRegistry,
|
||||||
BarGraphController
|
BarGraphController
|
||||||
@ -1801,7 +1808,7 @@ decide this.
|
|||||||
Next, we utilize this functionality from the template:
|
Next, we utilize this functionality from the template:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
<div class="example-bargraph">
|
<div class="example-bargraph" ng-controller="BarGraphController">
|
||||||
<div class="example-tick-labels">
|
<div class="example-tick-labels">
|
||||||
<div ng-repeat="value in [low, middle, high] track by $index"
|
<div ng-repeat="value in [low, middle, high] track by $index"
|
||||||
class="example-tick-label"
|
class="example-tick-label"
|
||||||
@ -1862,7 +1869,7 @@ First, let's add a tool bar for changing these three values in Edit mode:
|
|||||||
```diff
|
```diff
|
||||||
define([
|
define([
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
'./controllers/BarGraphController'
|
'./src/controllers/BarGraphController'
|
||||||
], function (
|
], function (
|
||||||
legacyRegistry,
|
legacyRegistry,
|
||||||
BarGraphController
|
BarGraphController
|
||||||
@ -2730,9 +2737,9 @@ with the platform):
|
|||||||
```diff
|
```diff
|
||||||
define([
|
define([
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
'./ExampleTelemetryServerAdapter',
|
'./src/ExampleTelemetryServerAdapter',
|
||||||
'./ExampleTelemetryInitializer',
|
'./src/ExampleTelemetryInitializer',
|
||||||
'./ExampleTelemetryModelProvider'
|
'./src/ExampleTelemetryModelProvider'
|
||||||
], function (
|
], function (
|
||||||
legacyRegistry,
|
legacyRegistry,
|
||||||
ExampleTelemetryServerAdapter,
|
ExampleTelemetryServerAdapter,
|
||||||
@ -2931,7 +2938,7 @@ will implement:
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
|
|
||||||
define(
|
define(
|
||||||
['./ExampleTelemetrySeries'],
|
['./src/ExampleTelemetrySeries'],
|
||||||
function (ExampleTelemetrySeries) {
|
function (ExampleTelemetrySeries) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@ -3046,9 +3053,9 @@ Finally, we expose this `telemetryService` provider declaratively:
|
|||||||
```diff
|
```diff
|
||||||
define([
|
define([
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
'./ExampleTelemetryServerAdapter',
|
'./src/ExampleTelemetryServerAdapter',
|
||||||
'./ExampleTelemetryInitializer',
|
'./src/ExampleTelemetryInitializer',
|
||||||
'./ExampleTelemetryModelProvider'
|
'./src/ExampleTelemetryModelProvider'
|
||||||
], function (
|
], function (
|
||||||
legacyRegistry,
|
legacyRegistry,
|
||||||
ExampleTelemetryServerAdapter,
|
ExampleTelemetryServerAdapter,
|
||||||
@ -3229,7 +3236,7 @@ We then need only to utilize these methods from our `telemetryService`:
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
|
|
||||||
define(
|
define(
|
||||||
['./ExampleTelemetrySeries'],
|
['./src/ExampleTelemetrySeries'],
|
||||||
function (ExampleTelemetrySeries) {
|
function (ExampleTelemetrySeries) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user