Sunday, 3 April 2016

Aurelia with C#

set up mvc project

add aurelia view to home,

add aurellia ActionResult method in home controller.. re map routing so aurelia opens first.

right click project solution and open the containing folder... using right cick run the cmd prompt from the rot directory of the project.

   jspm init  (yes to everything)
   jspm install aurelia-framework
   jspm install aurelia-bootstrapper

now aurellia view file acts as aurellia index... show all files in solution explorer.
right click config.js and "include"
jspm_packages not necessary to add.. but we will drag system.js & the config.js into the aurellai page to <script> link at top.

we will then <script>System.import("aurelia-bootstrapper")

<div aurelia-app="main"></div> - this tells where the aurelia app content will display
                   right click project at top of solution explorer - add> javascript file, name it main.
paste this in:
export function configure(aurelia) { aurelia.use .standardConfiguration() .developmentLogging(); aurelia.start().then(() => aurelia.setRoot()); }

this will set the root to app.js.. which we now create.... Like with the main.js file, add > app.js
            export class App{} // shell for now just to allow running
now add app.html page in the same way... and clear the auto generated code.

right click project>properties>web>select "specific page" and type "/"

     for now we can type <template>Aurelia has started.</template> and run it to confirm we see this message.

No comments:

Post a Comment