0

I am currently building a website for an organisation that I am involved with there will be a public facing section of the website and also a members section.

The public facing section will include pages such as "About", "News", "Events" etc and the members section will include a chat section for members, rehearsal schedules and other members features.

It is going to be a Azure hosted application with the members section written in Angular 2 with a WebAPI service.

However, I am unsure how to put the public facing section together so that it loads fast as Angular 2 seems to be quite slow on initial loading.

I could put the members section in a module and load it only when required but I am not sure how that would speed it up as I think that the JS would still need to be downloaded to the client.

I have considered writing the public facing pages in ASP.NET but I am not sure whether it is possible to mix that with Angular 2.

The final thought I have thought about is to have 1 Angular 2 app for the public pages, and a second for the members area as this would leave 2 smaller packages of javascript to send to the client.

Does anybody have any ideas or alternatives? Are there any flaws with my logic?

Al

1
  • I've tried Angular.js 1.xx with ASP.NET MVC and WebApi 2, it worked pretty well. basically any CRUD action was happening with Angular.JS and webapi controller was just passing data to database. Commented Feb 2, 2017 at 13:51

3 Answers 3

0

It is no problem to mix Angular with .Net. We are doing java applicaton build with Java/JSP and using Angular controllers.

Sign up to request clarification or add additional context in comments.

Comments

0

In order to minimalize loading for you Angular application, you could consider:

  • Use Angular minified version for production from a CDN.

Some advantages of using a CDN:

  • Files may be pre-cached.
  • Distributed data centers.

Also you could:

  • Minify and concatenate all your custom JavaScript code and CSS for production.

1 Comment

I am currently using webpack to package up the javascript but i thought that if i have 2 Angular 2 apps then the bundles would be smaller and therefore faster but I am not sure whether it is possible to link them together via an "umbrella" app
0

If your concern is startup time and you don't want to have two angular-2 projects. I believe the Lazy Loading a Module can solve the problem.

With lazy loading our application does not need to load everything at once, it only needs to load what the user expects to see when the app first loads. Modules that are lazily loaded will only be loaded when the user navigates to their routes. --Lazy Loading a Module

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.