Skip to content

Instantly share code, notes, and snippets.

@dervalp
Last active August 29, 2015 14:00
Show Gist options
  • Save dervalp/11374735 to your computer and use it in GitHub Desktop.
Save dervalp/11374735 to your computer and use it in GitHub Desktop.
Api test
//registering a Model in Grail
var grailed = require("grail");
var app = grailed("MyApplication");
app.config({
initialise: function () {
/* Require all configs */
require('./config/moldy.config');
},
eventsToWaitFor: [
/* Core */
'events.initialised',
'helpers.initialised',
'models.initialised',
'services.initialised',
/* Custom */
'ngcontroller.initialised',
'ngroutes.initialised'
]
});
app.engine( require("grailed-angular-engine") );
//registering a Model in Grail
app.model( Moldy.extend('person', require('../../schemas/person.schema')) );
//registering a Controller in Grail
app.controller( 'mainService', {
route: '/',
templateUrl: '/partials/main.html',
controller: require('./services/main.service.js')
} );
app.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment