aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts/notes.js
diff options
context:
space:
mode:
authorTeddy Wing2015-01-24 09:41:57 -0500
committerTeddy Wing2015-01-24 09:41:57 -0500
commitc764e3b3964e137038b964c44b0b736828478868 (patch)
tree9c26044cfbedf6c8b5885a9a130540b456dc4b57 /app/assets/javascripts/notes.js
parentac4ca71de63bc3ab75b520cfe382040926079982 (diff)
downloadNotes-angular-demo-c764e3b3964e137038b964c44b0b736828478868.tar.bz2
Create initial Notes Angular app
Lists all notes and populates content section with the body of a note when one is clicked.
Diffstat (limited to 'app/assets/javascripts/notes.js')
-rw-r--r--app/assets/javascripts/notes.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
new file mode 100644
index 0000000..9a92f3e
--- /dev/null
+++ b/app/assets/javascripts/notes.js
@@ -0,0 +1,15 @@
+(function() {
+ angular
+ .module('nt.Notes', [
+ 'nt.NoteService'
+ ])
+ .controller('MainController', [
+ '$scope',
+ 'NoteService',
+ function($scope, NoteService) {
+ $scope.noteService = NoteService;
+
+ $scope.noteService.get_notes();
+ }
+ ]);
+})();