Fortune admin is an angular component that provides a CRUD UI, and an ERD for a fortune instance. It's designed to be used as a bower module included in a host app, however for testing we also provide a node JS host app (examples/server.js) with a simple Angular/HTML container (examples/index.html).
-
bower install in the root of the repository
-
cd into examples
-
npm install
-
node server.js
-
open your browser and navigate the interface; the top navigation has links to the UML
-
Add .css and .js fortune-admin files
-
include
fortune-admin
to your app deps -
set mount point in your routes configuration
-
add a menu link pointing to where you mount fortune-admin + '/uml'
angular.module('yourApp', [
'ngRoute',
'fortuneAdmin'
])
.config('$routeProvider', '$locationProvider', 'fortuneAdminProvider',
function($routeProvider, $locationProvider, fortuneAdminProvider){
//Your routes go here.
//1. Point plugin to your running fortune service
fortuneAdminProvider.setApiHost('http://some.other.host.com');
//2. Provide api namespace as configured in fortune
fortuneAdminProvider.setApiNamespace('/api/v2');
//3. Mount plugin to any route of your choice
fortuneAdminProvider.mountTo($routeProvider, '/admin');
//fortune-admin defaults to use html5Mode
$locationProvider.html5Mode(true);
});
fortuneAdminProvider has html5Mode method which accepts a boolean and optional hash prefix
fortuneAdminProvider.html5Mode(false, '!');
$locationProvider.hashPrefix('!');