Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://pastebin.com/B0cddPP7
- angular.module('app', ['Filters'])
- .controller('EditController', ['$rootScope', function (s) {
- s.posts = [];
- s.post = { title: '', content: '', author: '', date: new Date() }
- s.save = function () {
- var p = {
- title: s.post.title, author: s.post.author,
- date: s.post.date, content: s.post.content
- }
- s.posts.push(p);
- s.post = { title: '', content: '', author: '', date: new Date() }
- }
- }])
- .controller('ListController', ['$rootScope', function (s) {
- s.posts = [];
- }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement