SPA pre-rendering in Asp.net core? - angularjs

How do i implement prerenderio in asp.net core, for angular spa. Or is there any way that asp.net core has introduced to do this. Actually i am migrating my old asp.net to asp.net core.

There is a package offered by Microsoft which allows to pre-render/execute Nodejs/JavaScript on the server side, commonly known under "JavaScriptServices". You can find it on the ASP.NET team's GitHub repository.
There are different packages that build up on different packages. The Microsoft.AspNetCore.NodeServices is the base package, usually used for people who implement their own server-sided execution based on NodeJS. Then there is Microsoft.AspNetCore.SpaServices which is based on NodeServices and tailored for single plage applications (SPAs) and finally there is a Microsoft.AspNetCore.AngularServices package which provides Angular specific extensions and is based on SpaServices.
On the GitHub you can find examples, for example the MusicStore SPA with server-side rendering.

Related

How can I add integrate a React app into an existing asp.net core application?

I've written a small app with MERN stack, and a software company have asked if they can integrate it as a module in their ASP.NET Core / SQL Server application they offer to engineering companies. Will this be a simple procedure or is it going to work out quicker and easier to rebuild it with ReactJS.net and then add it to their solution?

ADAL, Angular and WEB API strategy

I am a Microsoft developer. Making an ASP.NET application with authentication to Azure AD is very easy. The traditional multi page application with Vue (as an example) can be created within two minutes (by using the Authentication wizard in Visual Studio). However watching some Angular and NPM videos I liked the CLI/npm approach. So I decided to build my next project using ADAL.js, ASP.NET Core API and Angular 6 (deploy to Azure web app). But I haven't been able to succeed, and have only been met by complexity and issues.
Is the combo of these three technologies just a bad mix, Visual Studio not suited for SPA, or have I just gotten a bad start? Any suggestions on a good setup? I am considering to split the API and front end in two apps, so I can use clean Angular without having to worry about who is building TypeScript (VS or Node) etc. But then I need two web apps, and have to worry about CORS. Any suggestions here, what is a good setup to get started?
I have followed a lot of articles like:
http://www.talkingdotnet.com/how-to-create-an-angular-6-app-with-visual-studio-2017/
https://www.npmjs.com/package/microsoft-adal-angular6
But all of them had issues.
Refer to this Microsoft published GitHub sample. This sample demonstrates the use of ADAL for JavaScript for securing an AngularJS based single page app, implemented with an ASP.NET Web API backend, that calls another ASP.NET Web API using CORS.
Call an Azure AD protected Web API in an AngularJS Single Page App

Developing AngularJS 1.6 application without NodeJS.

What are the points to keep in mind for application using AngularJS v1.6 without Node.
This application will connect with Java API and using eclipse for local development.
What are the possible drawbacks one can face in such scenario including deployment scenario?
Thanks in advance.
You can have Angularjs application without node as independent.
node.js is used to write Javascript on the server side. You can install npm (node packaged modules) to use some awesome tools that will make your life as an angular developer much easier.
They use to go together as the MEAN Stack. You can have your Java API separately and a separate standalone SPA application which consumes those services.
There are certain things that you may need to consider such as,
CORS
Package Management
Bundling

Include the firebase-admin SDK module in angularjs

I want to use firebase-admin in angularJS but i don't know to do that.
any help will be appreciated. thanks.
The Firebase Admin SDK is designed for use in trusted environments, such as server-side node or server-side Java. It is not meant to be directly used in client-side environments, which is where Angular is targeted.
There are valid use-cases for showing the information from the Firebase Admin SDK in a client (such as an administrative web interface). But in those cases, you will have to create your own server-side node.js API (e.g. through Express) and consume that in your Angular app.

Is requirement of AngularJS for big web based app necessary?

I wanted to build a maven based project based on google app engine which uses RESTful web services. So is angularJS really required in this type of project or can it be achieved without it also?
No, AngularJS is not required. While it provides a $resource module that works with RESTful web services, you can use other front-end tools as well. For example, smartphone apps written in their native languages can use RESTful services.

Resources