Skip to content

Instantly share code, notes, and snippets.

@zjfong
Last active September 16, 2016 22:22
Show Gist options
  • Save zjfong/5aa0cfaa1579b21bd47f924173a380ac to your computer and use it in GitHub Desktop.
Save zjfong/5aa0cfaa1579b21bd47f924173a380ac to your computer and use it in GitHub Desktop.
Angular app CRUD
  • initialize angular app in app.js and index.html
  • create a controller
  • create the controller function
  • declare where you use the controller in your view
  • display data from controller

--

  • inject $http to controller
  • set up GET request
  • show response

--

  • set up a form
  • set up a button
  • in form tag, add submit event handler
  • declare event handler function that makes a POST request
  • push response to resource

--

  • set up a button
  • add click event handler to button
  • declare event handler function that makes a DELETE request
  • splice at index

--

  • set up a form
  • set up a button
  • add event handler to button
  • declare event handler function that makes a PUT request
  • splice at index and replace with response data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment