SauceJs is an AngularJS binding for moving your functions to a jSauce node server. Following the example of the included demo, you can create front end applications that do not expose all of your javascript source code.
- Include the saucejs.js script in your applicaton's html head or body.
<script type="text/javascript" src="lib/saucejs.js"></script>
- Add the souce binding to your angularjs application's module decleration.
var coLab = angular.module('coLab', ['firebase', 'sauce']);
- Add the sauceJs factory to your controllers
function coLabCtrl($scope, angularFire, z_, $routeParams, $location){
...
- Add functions to the recipes.js exports.have object
test : function(a){
return { val: 1, scope : {test : 1 }, exec : "alert('test')", local : { test : 1 } } ;
}
- Call the function from your controller in the SauceJs way. Note that the function is named twice and no arguments are defined. This is the unifored approach to calling any function you convert to sauceJs.
scope.test = function test(){
return z_._(arguments);
}
You can also create multiple function links at once :
z_.SecretSauce(['fun1', 'fun2', 'fun3'], $scope);
// In this example, $scope.fun1() would become callable as with the other function names listed.
npm install -g express
MIT
Contact @StonlyBaptise if you have any questions.