[Example] Add example using directives

Add example of binding a directive with Angular using
declarative syntax. WTD-518.
This commit is contained in:
Victor Woeltjen 2014-11-04 16:02:36 -08:00
parent b712c9a401
commit d3c979fa6f
3 changed files with 29 additions and 2 deletions

View File

@ -10,7 +10,10 @@
} }
], ],
"directives": [ "directives": [
{
"key": "exampleDirective",
"implementation": "ExampleDirective.js"
}
], ],
"routes": [ "routes": [
{ {

View File

@ -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>

View 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;
}
);