c# - How do I use SuperAgent in a simple MVC 5 app? -
okay, know should able figure out, can't. trying use superagent.js in simple html page in mvc 5 app building. project standard vs 2015 project mvc , blank html page more or less.
i able create bower.json , reference superagent package. get: javascript runtime error: module name "emitter" has not been loaded yet context: _. use require([])
i have code, think wrong:
<script src="~/wwwroot/lib/requirejs/require.js"></script> <script src="~/wwwroot/lib/superagent/lib/client.js"></script> <script> var superagent = require('superagent'); var data = superagent .get('/api/v1/actualhourlyvalues') .end(function (err, res) { // calling end function send request }); alert(data); </script>
i guess don't know steps involved in using bower or npm bring in package superagent can use make ajax calls.
i need steps creation of html! :)
Comments
Post a Comment