From 13eb4df71a2d304d13b37cfc15eac4c76870adce Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 3 Feb 2017 21:33:09 +0100 Subject: Add hello.component.js Create a new component for a Hello World example. This is housed in a new `n.Hello` module. For now, just print a hard-coded name to the page. Update the `n.Notes` module adding a dependency on `n.Hello` in order for our new component to be displayed. --- app/assets/javascripts/app.js | 2 +- app/assets/javascripts/hello/hello.component.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/hello/hello.component.js diff --git a/app/assets/javascripts/app.js b/app/assets/javascripts/app.js index c7aacc8..2f7f6ba 100644 --- a/app/assets/javascripts/app.js +++ b/app/assets/javascripts/app.js @@ -1,5 +1,5 @@ (function(angular) { - angular.module('n.Notes', []); + angular.module('n.Notes', ['n.Hello']); })(window.angular); diff --git a/app/assets/javascripts/hello/hello.component.js b/app/assets/javascripts/hello/hello.component.js new file mode 100644 index 0000000..d1601f2 --- /dev/null +++ b/app/assets/javascripts/hello/hello.component.js @@ -0,0 +1,12 @@ +(function(angular) { + + angular + .module('n.Hello', []) + .component('hello', { + template: '