aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts/notes.js
diff options
context:
space:
mode:
authorTeddy Wing2016-10-06 18:38:14 -0400
committerTeddy Wing2016-10-06 18:38:14 -0400
commit1d6fa22853b724025461aca3d8b7b939c9fc2dba (patch)
treef2b25601dba11abb62476a115bdb21b2c855269f /app/assets/javascripts/notes.js
parentc7aad39abdb200d85915fe98fdf21000599552fa (diff)
downloadNotes-angular-demo-firehose-project-mentor-session-prep-20161006.tar.bz2
Prepare for mentor session with Andrew Clark. Refresh my memory on how this all works and is implemented by rewriting the code, using the code from Dany's live session as a reference.
Diffstat (limited to 'app/assets/javascripts/notes.js')
-rw-r--r--app/assets/javascripts/notes.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
new file mode 100644
index 0000000..00ccf3e
--- /dev/null
+++ b/app/assets/javascripts/notes.js
@@ -0,0 +1,14 @@
+(function(angular) {
+ angular
+ .module('nt.Notes', [
+ 'nt.NotesService'
+ ])
+ .controller('MainController', [
+ '$scope',
+ 'NotesService',
+ function($scope, NotesService) {
+ $scope.notesService = NotesService;
+ NotesService.fetch();
+ }
+ ]);
+})(window.angular);