Skip to content

Instantly share code, notes, and snippets.

@sfnewzgirl
Last active September 16, 2016 22:27
Show Gist options
  • Save sfnewzgirl/efc715c0a1f5cb9d87489ad1e0b2fc57 to your computer and use it in GitHub Desktop.
Save sfnewzgirl/efc715c0a1f5cb9d87489ad1e0b2fc57 to your computer and use it in GitHub Desktop.
Create a Gist of all the steps you would take to create an Angular app from scratch

Updated List for Books App (Front End Only)

#Index.html

  1. ng-app
  2. ng-view
  3. script and route module in header

#View Templates

  1. template for all books
  2. template for book by id
  3. template for update form (show/hide)
  4. they go inside views/templates

#Appjs

  1. config controller
  2. .when all books
  3. .when one book

#JS Controllers

  1. delete controller for each book
  2. edit controller for each book
  3. they go in controllers dir inside public/scripts

#Things to check

  1. npm install
  2. bower install
  3. run python server

(Brain storm Angular front to back)

#Set Up & Organization *create local directory *create folders and file structures *npm init *npm install *install body-parser *bower install *git init *create GitHub repo

#Models *create a model file for each object *require mongoose *create schema for each object *create model for each object *create export for each model *set up index model

#Controllers *create object controllers *require models *create routes for each objects CRUD options *module.exports *put module.exports in index controller

#Set Up Server.js *require express *require body-parser *set up statice files *require controllers *set up homepage and template routes *map out json endpoints (CRUD/RESTful routes) *set angular (get *) *set up port 3000 listener

#Set Up Front End *Code HTML boilerplate *Create basic HTML structure *Add ng-app="app name" in HTML *require angular in vendor scripts

*Front End Controllers *set up angular .module in app.js *define .controller in app.js *inject $http in controller *create controller function for each route *define vm in controller *call controller in HTML and create alias *use ng-model for any data gathering from user *create "templates" in HTML for angular to fill with {{}} *use ng-repeat for iterating template spots *create any HTML angular needs for user flow/user stories

#Things to Check On *Do I need separate JS files for logic and controllers? *Do I have front end and back end controllers created properly? *Use console.log to check the flow of data. *Do all my API endpoints work?

#Finishing Touches *style, style, style with CSS!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment