-
Notifications
You must be signed in to change notification settings - Fork 46
Setup
Stefan Prodan edited this page Aug 31, 2014
·
4 revisions
- Install the RequireJsNet package
- Create an adequate folder structure: the entrypoint for each page will be loaded from
~/Scripts/Controllers/{area}/{controller}/{action}
. If the action you're rendering is not in an area, replace{area}
withroot
- Create a configuration file. You can define your configuration in either xml (.config) or json (.json) format. If you don't specify any configuration when rendering, the default will be loaded from
~/RequireJS.json
. Read more about configuration files here. - Using the RenderRequireJsSetup helper, render the script (generally you want this in your layout file, before you close the body tag). See _LayoutSimple for an example.
A detailed tutorial of the setup process is available on requirejsnet.veritech.io
[Passing values between ASP.NET and JavaScript] (https://github.com/vtfuture/RequireJSDotNet/wiki/Passing-values-between-ASP.NET-and-JavaScript)