Skip to content

Instantly share code, notes, and snippets.

@tuchk4
Last active November 24, 2015 11:55
Show Gist options
  • Save tuchk4/f76f10da3f186bdeee86 to your computer and use it in GitHub Desktop.
Save tuchk4/f76f10da3f186bdeee86 to your computer and use it in GitHub Desktop.
Valentjs simple examples
import Angular from 'valent/angular';
let framework = new Angular({
module: 'your-application-name'
});
valent.bootstrap(framework);
import UserPermissionsDataSource from 'data-sources/user-permissions';
valent.config.route.otherwise('/home');
let userPermissions = new UserPermissionsDataSource();
/**
* Add global resolver. Will be added for all routes
* Global resolvers alwasy will be executed before local route resolvers
* http://i.imgur.com/eO43UR5.png
*/
valent.config.route.addResolver('permissions', (model) => {
return userPermissions.load();
});

Valentjs examples

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