Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var portal = new Vue({
  2. el: "#AnnounceController",
  3. data: {
  4. ann: {
  5. id: '',
  6. content: ''
  7. },
  8. announces: [],
  9. success: false,
  10. edit: false
  11. },
  12. methods: {
  13.  
  14. fetchAnnounce: function () {
  15. axios.get('/api/announces')
  16. .then(function (response) {
  17. this.announces = response.data;
  18. console.log(this.announces);
  19. })
  20. .catch(function (error) {
  21. console.log(error);
  22. });
  23. }
  24. },
  25. computed: {},
  26.  
  27. mounted: function () {
  28. console.log('mounted')
  29. this.fetchAnnounce()
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement