Last active
November 24, 2015 11:55
-
-
Save tuchk4/f76f10da3f186bdeee86 to your computer and use it in GitHub Desktop.
Valentjs simple examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Angular from 'valent/angular'; | |
let framework = new Angular({ | |
module: 'your-application-name' | |
}); | |
valent.bootstrap(framework); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment