From 81907ce88870bedac988566d7239db786d6d2aa3 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 17 Mar 2016 12:03:34 -0600 Subject: [PATCH] Readme --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d83b22 --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +# Leean CMS + +> An AngularJS module for loading content from a CMS. + + +## Getting Started + +The easiest way to install this package is by using npm from your terminal: + +``` +npm install --save-dev leean-cms +``` + + +# Usage + +First you need to create an ```ngConstants``` module with the apiBase. For example: + +``` +angular.module('ngConstants', []) + .constant('apiBase', 'http://localhost:3000/'); +``` + +Then you need to add the CMS module as a dependency to your app: + + ``` +angular + .module('app', [ + 'lnCms' + ]); +``` + +The module provides a controller which loads data form your CMS as the route changes. It makes that data available to various directives. A basic outline for you html is: + + ```html + + + + + + + + + + + + + +``` + +### LnCmsController + +Listens for route changes and sends a message to the CMS for data each time. It also loads static data once when the app loads. It expects API endpoint terminating in /post and /static for this. + +It looks for a template named after the data type returned from the API. + +### ln-cms-view Directive + +Compiles the template and passes the view and static data on to sub-directives. + +### ln-cms-meta Directive + +(not yet complete) Updates the meta information.