Could someone show me the process to easily formulate an MVC SPA application. I am having a hard time getting to grips on how to establish functionality based on layout page and rendering appropriate views for navigation. I have searched resources and YouTube
and cant find anything all for the exception of built in templates which i do not want to use. Thanks. Markus
a SPA application is javascript application. MVC would only be used to support ajax calls from the javascript application. MVC would also host the index.html page that is the javascript application and its resource files (css, images, javascript)
SPA applications use browser api for routing and do not call the server for pages. Generally you would pick a javascript framework to build your SPA application, say react, vue or angular. these frameworks have build tools that build the javascript and
index.html files your MVC site will host.
##create react spa
npx create-react-app myapp
cd myapp
npm start
## create vue spa
npm install -g @vue/cli
vue create myapp
## answer questions
cd myapp
npm run serve
## create angular spa
npm install -g @angular/cli
ng new myapp
cd myapp
ng serve
Thanks for the info Bruce. But it seems as though you are using npm project. I am still trying to learn SPA in Angular in MVC project. How can adding these files from CLI help any? Markus.
Almost all spa projects are built using the node tool chain. Angular uses typescript, and node is required to transpile the typescript to JavaScript. The angular cli is written in node.
Member
251 Points
423 Posts
The SPA Process.
Dec 11, 2018 02:12 PM|Markus33|LINK
Could someone show me the process to easily formulate an MVC SPA application. I am having a hard time getting to grips on how to establish functionality based on layout page and rendering appropriate views for navigation. I have searched resources and YouTube and cant find anything all for the exception of built in templates which i do not want to use. Thanks. Markus
All-Star
58444 Points
15765 Posts
Re: The SPA Process.
Dec 11, 2018 04:44 PM|bruce (sqlwork.com)|LINK
a SPA application is javascript application. MVC would only be used to support ajax calls from the javascript application. MVC would also host the index.html page that is the javascript application and its resource files (css, images, javascript)
SPA applications use browser api for routing and do not call the server for pages. Generally you would pick a javascript framework to build your SPA application, say react, vue or angular. these frameworks have build tools that build the javascript and index.html files your MVC site will host.
Member
251 Points
423 Posts
Re: The SPA Process.
Dec 12, 2018 02:15 PM|Markus33|LINK
Thanks for the info Bruce. But it seems as though you are using npm project. I am still trying to learn SPA in Angular in MVC project. How can adding these files from CLI help any? Markus.
All-Star
58444 Points
15765 Posts
Re: The SPA Process.
Dec 12, 2018 03:24 PM|bruce (sqlwork.com)|LINK