mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[Example] Add example using directives
Add example of binding a directive with Angular using declarative syntax. WTD-518.
This commit is contained in:
parent
b712c9a401
commit
d3c979fa6f
@ -10,7 +10,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"directives": [
|
"directives": [
|
||||||
|
{
|
||||||
|
"key": "exampleDirective",
|
||||||
|
"implementation": "ExampleDirective.js"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"routes": [
|
"routes": [
|
||||||
{
|
{
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
<p>Hello, world! I am the default route.</p>
|
<p>Hello, world! I am the default route.</p>
|
||||||
<p ng-controller="ExampleController">My controller has told me: "{{phrase}}"</p>
|
<p ng-controller="ExampleController">My controller has told me: "{{phrase}}"</p>
|
||||||
|
<span example-directive></span>
|
23
example/builtins/src/ExampleDirective.js
Normal file
23
example/builtins/src/ExampleDirective.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/*global define,Promise*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module defining ExampleDirective. Created by vwoeltje on 11/4/14.
|
||||||
|
*/
|
||||||
|
define(
|
||||||
|
[],
|
||||||
|
function () {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
function ExampleDirective() {
|
||||||
|
return {
|
||||||
|
template: "And this came from a directive."
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return ExampleDirective;
|
||||||
|
}
|
||||||
|
);
|
Loading…
Reference in New Issue
Block a user