SHARE
TWEET

Untitled

a guest Jan 25th, 2016 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #### View
  2. <h2>{{ NoteShowCtrl.note.title }}</h2>
  3. <div>
  4.   <p>
  5.     {{ NoteShowCtrl.note.learned.join(',')}}
  6.   </p>
  7.   <p>
  8.     {{ NoteShowCtrl.note.fun.join(',')}}
  9.   </p>
  10.   <p>
  11.     {{ NoteShowCtrl.note.todoList.join(',')}}
  12.   </p>
  13.   <p>
  14.     {{ NoteShowCtrl.note.content }}
  15.   </p>
  16. </div>
  17. <a ng-href="#/notes/{{NoteShowCtrl.note.id}}/edit"> Edit</a>
  18. <a href="" ng-click="NoteShowCtrl.deleteNote(NoteShowCtrl.note)"> Delete</a>
  19.  
  20.  
  21. #### Controller
  22.  
  23. 'use strict';
  24.  
  25. angular.module('DiaryApp').controller('NoteShowController', ['Note','$routeParams', '$location', function(Note, $routeParams, $location) {
  26.     this.note = Note.get({id: $routeParams.id});
  27.  
  28.     this.deleteNote = function(note) {
  29.       note.$remove().then(function() {
  30.         $location.path('/notes');
  31.       });
  32.     };
  33. }]);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top