Advertisement
NelloRizzo

[AJS] App

Mar 14th, 2017
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // http://pastebin.com/B0cddPP7
  2. angular.module('app', ['Filters'])
  3. .controller('EditController', ['$rootScope', function (s) {
  4.     s.posts = [];
  5.     s.post = { title: '', content: '', author: '', date: new Date() }
  6.     s.save = function () {
  7.         var p = {
  8.             title: s.post.title, author: s.post.author,
  9.             date: s.post.date, content: s.post.content
  10.         }
  11.         s.posts.push(p);
  12.         s.post = { title: '', content: '', author: '', date: new Date() }
  13.     }
  14. }])
  15. .controller('ListController', ['$rootScope', function (s) {
  16.     s.posts = [];
  17. }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement