Migration from Razor (asp.net) to Angular JS as a template engine

后端 未结 1 1056
北海茫月
北海茫月 2021-02-02 01:09

We were using ASP.NET Razor, and we heavily used Razor to generate HTML, include partial views in layouts, and stuff like that.

However, now that Angular is out and robu

相关标签:
1条回答
  • 2021-02-02 01:26

    I am not even sure you have an issue here. Both engines do the same thing essentially, the difference being that Angular JS happens on the client and Razor happens on the server. By all means, shift the dynamic parts to the client if the rendering and logic does not require the server to do so.

    If I were you I'd still use Razor files to generate the final html. You might find it useful in the future for those times when something must be generated on the server. Perhaps you could end up serving an entirely different control based on user-permissions. This is important because if security-sensitive rendering is occurring on the client, it can potentially be circumvented by someone. However if that code never arrives because the server generated it, you're in a better place.

    0 讨论(0)
提交回复
热议问题