Created
December 1, 2014 21:10
-
-
Save emiaj/8d1b05352860c7fc7040 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require.config({ | |
paths: { | |
'rest': '/webjars/Rest/' + webjars.versions['Rest'], | |
'when': '/webjars/when-node/' + webjars.versions['when-node'] | |
}, | |
map: { | |
'rest': { | |
'when': 'when/when', | |
'when/lib':'when/lib' | |
} | |
} | |
}); | |
// testing | |
require(["rest/browser","rest/interceptor/mime","rest/interceptor/errorCode"],function(rest,mime,errorCode){ | |
var client = rest.wrap(mime).wrap(errorCode, {code:400}); | |
client({ path: '/assets/json/data.json' }).then( | |
function(response) { | |
console.log('response: ', response); | |
}, | |
function(response) { | |
console.error('response error: ', response); | |
} | |
); | |
}); | |
require(["when/when"],function(when){ | |
console.log(when); | |
}); |
This file contains hidden or 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
<html> | |
.... | |
<body> | |
.... | |
<script> | |
@Html(org.webjars.RequireJS.getSetupJavaScript(routes.WebJarAssets.at("").url)) | |
</script> | |
<script data-main="@routes.Assets.at("javascripts/main.js")" | |
src="@routes.WebJarAssets.at(WebJarAssets.locate("require.min.js"))"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment