Day 14: Wrapping up Meganote

Friday, June 17, 2016

Topics

Markdown

Add a README.md Markdown file to your projects to explain setup and usage. Your users and your future self will thank you.

CORS

Mongoose

  • .sort()
  • .findOne()
  • Middleware / Hooks
    • Set up events to occur before or after a supported Document, Query, or Model function
    • schema.pre('save') - to occur before a save function
    • schema.post('save') - to occur after a save function

Third-Party Packages added to Meganote

  • Sanitize HTML (Node)
    Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis.
  • HTML-to-Text (Node)
    An advanced converter that parses HTML and returns beautiful text.
  • textAngular (Angular)
    A Lightweight, Two-Way-Bound & Totally Awesome Angular.js Text-Editor.

More ui-router

  • ui-sref - A directive that binds an anchor tag (<a>) to a state
  • URL Routing with Parameters
  • Nested States and Views - Also known as child states
  • Resolve - Provides your controller with content or data that is custom to the state. Any promises will be resolved and converted to a value before instantiating the controller.

More Angular

  • ng-bind-html - tells Angular to replace the innerHTML of an element with the value of an expression. Similar to {{ expression }}
  • .constant - register a Provider on an angular module that returns a constant value
  angular.module('myApp')
    .constant('API_URL', 'http://myapi.com/example/all');