From d60b1eb67c2c4878955458f5378911d5d54b6a95 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 3 Feb 2017 21:40:29 +0100 Subject: hello.component.js: Add to edit name Add an input to the component and use an `ng-model` to allow users to change the name in the "Hello ____" output. --- app/assets/javascripts/hello/hello.component.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/hello/hello.component.js b/app/assets/javascripts/hello/hello.component.js index d1601f2..056cd39 100644 --- a/app/assets/javascripts/hello/hello.component.js +++ b/app/assets/javascripts/hello/hello.component.js @@ -3,9 +3,11 @@ angular .module('n.Hello', []) .component('hello', { - template: '

Hello {{ $ctrl.name }}

', + template: + '

Hello {{ $ctrl.name }}

' + + '', controller: function() { - this.name = 'World'; + this.name = ''; } }); -- cgit v1.2.3