Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to use angular along with ASP.NET mvc project

How to use angular along with ASP.NET mvc project

Scheduled Pinned Locked Moved ASP.NET
javascriptasp-netcsharpsysadminarchitecture
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nitin S
    wrote on last edited by
    #1

    How to use angular along with ASP.NET mvc project?

    Aren't Angular and ASP.NET MVC mutually exclusive? I mean angular is totally different than asp.net mvc, here(asp.net) code executes on server and in another(angular) js code executes on client side. asp.net view and angular view are totally different

    ===================================================== The grass is always greener on the other side of the fence

    K V J 3 Replies Last reply
    0
    • N Nitin S

      How to use angular along with ASP.NET mvc project?

      Aren't Angular and ASP.NET MVC mutually exclusive? I mean angular is totally different than asp.net mvc, here(asp.net) code executes on server and in another(angular) js code executes on client side. asp.net view and angular view are totally different

      ===================================================== The grass is always greener on the other side of the fence

      K Offline
      K Offline
      Keviniano Gayo
      wrote on last edited by
      #2

      There's an existing template in visual studio 2017 in .net core that use angular. I suggest you can see that project on how it works as a starting point.

      Quote:

      asp.net view and angular view are totally different

      An overview, asp.net view runs on server side and will return html to browser then AngularJS will then inspect the generated html (from server/asp.net) and executes to render and set the behavior accordingly.

      [Signature space for sale]

      1 Reply Last reply
      0
      • N Nitin S

        How to use angular along with ASP.NET mvc project?

        Aren't Angular and ASP.NET MVC mutually exclusive? I mean angular is totally different than asp.net mvc, here(asp.net) code executes on server and in another(angular) js code executes on client side. asp.net view and angular view are totally different

        ===================================================== The grass is always greener on the other side of the fence

        V Offline
        V Offline
        Vincent Maverick Durano
        wrote on last edited by
        #3

        Nitin Sawant wrote:

        I mean angular is totally different than asp.net mvc, here(asp.net) code executes on server and in another(angular) js code executes on client side. asp.net view and angular view are totally different

        True.

        Nitin Sawant wrote:

        How to use angular along with ASP.NET mvc project?

        Angular is somewhat a client-side MVC. You can probably mix Angular and ASP.NET MVC but it's not ideal. You could however use ASP.NET Core / ASP.NET Web API with Angular to communicate with your data from the server and if you are really trying to build a SPA application.

        N 1 Reply Last reply
        0
        • V Vincent Maverick Durano

          Nitin Sawant wrote:

          I mean angular is totally different than asp.net mvc, here(asp.net) code executes on server and in another(angular) js code executes on client side. asp.net view and angular view are totally different

          True.

          Nitin Sawant wrote:

          How to use angular along with ASP.NET mvc project?

          Angular is somewhat a client-side MVC. You can probably mix Angular and ASP.NET MVC but it's not ideal. You could however use ASP.NET Core / ASP.NET Web API with Angular to communicate with your data from the server and if you are really trying to build a SPA application.

          N Offline
          N Offline
          Nitin S
          wrote on last edited by
          #4

          You can probably mix Angular and ASP.NET MVC but its not ideal.

          I wonder what is ideal to use with Angular I mean for authentication & db connectivity etc.

          ===================================================== The grass is always greener on the other side of the fence

          V 1 Reply Last reply
          0
          • N Nitin S

            You can probably mix Angular and ASP.NET MVC but its not ideal.

            I wonder what is ideal to use with Angular I mean for authentication & db connectivity etc.

            ===================================================== The grass is always greener on the other side of the fence

            V Offline
            V Offline
            Vincent Maverick Durano
            wrote on last edited by
            #5

            Quote:

            I wonder what is ideal to use with Angular I mean for authentication & db connectivity etc.

            ASP.NET Core/ Web API as your back-end is the way to go.

            1 Reply Last reply
            0
            • N Nitin S

              How to use angular along with ASP.NET mvc project?

              Aren't Angular and ASP.NET MVC mutually exclusive? I mean angular is totally different than asp.net mvc, here(asp.net) code executes on server and in another(angular) js code executes on client side. asp.net view and angular view are totally different

              ===================================================== The grass is always greener on the other side of the fence

              J Offline
              J Offline
              jkirkerx
              wrote on last edited by
              #6

              I've been pondering the notion of mixing Angular with .Net MVC as well for about 3 weeks now. Noticed how I wrote Angular and not AngularJS? AngularJS was the first version, then they changed the name to just Angular. I just added Angular 5 to my .Net Core 2.1 project, and will write some Angular stuff next week. So I'm moving forward with it and decided to adopt it. Why? I questioned why so many software recruiters are looking for the Senior .Net Core 2 and Angular guy, and thought why? There both MVC except one is client and one is server. So I started searching the interwebs for the answer and this is what I found. Weather.com At first, I found weather.com, that uses Angular to display the weather for your city for that day. A single page app in which you can move to the next day, or a week, 10 day forecast, and the home page "Wall" of weather related topics. So I get it. TV Guide The I went to TV Guide, and saw similiar technology being used for TV Listings. You can hit next and get the listings for the next hour. Makes sense to me here as well. Navigation After that I realized that it could be used for menu's and navigation as well. Being able to take a Bootstrap dropdown menu and use Angular to populate departments, categories instead of the menu being static. Or create flyouts ads, and grab an ad using Angular and then animate it. My thoughts So MVC has the controller and Models, then you create a limited view, and finish it off with Angular. When I look at .Net Core 2.1, I can see how you can build a limited version of core with a couple View pages and serve up Angular or ReactJS pages instead. I'm looking at the Angular Demo now, and that would be too hard core for me to start with. I choose to use NPM and distribute it with Gulp and bundle it, and will try building another Angular page within a View. Summary Well that's as far as I have gotten on the subject. But once again it's another move towards shifting server CPU loads and bandwidth back to the client and use their CPU power and electricity to generate a page. Servers can just send Json formatted data. I'll find out in time if it's worth it or not, plus I have zero debate points to argue in favor of it.

              If it ain't broke don't fix it Discover my world at jkirkerx.com

              V 1 Reply Last reply
              0
              • J jkirkerx

                I've been pondering the notion of mixing Angular with .Net MVC as well for about 3 weeks now. Noticed how I wrote Angular and not AngularJS? AngularJS was the first version, then they changed the name to just Angular. I just added Angular 5 to my .Net Core 2.1 project, and will write some Angular stuff next week. So I'm moving forward with it and decided to adopt it. Why? I questioned why so many software recruiters are looking for the Senior .Net Core 2 and Angular guy, and thought why? There both MVC except one is client and one is server. So I started searching the interwebs for the answer and this is what I found. Weather.com At first, I found weather.com, that uses Angular to display the weather for your city for that day. A single page app in which you can move to the next day, or a week, 10 day forecast, and the home page "Wall" of weather related topics. So I get it. TV Guide The I went to TV Guide, and saw similiar technology being used for TV Listings. You can hit next and get the listings for the next hour. Makes sense to me here as well. Navigation After that I realized that it could be used for menu's and navigation as well. Being able to take a Bootstrap dropdown menu and use Angular to populate departments, categories instead of the menu being static. Or create flyouts ads, and grab an ad using Angular and then animate it. My thoughts So MVC has the controller and Models, then you create a limited view, and finish it off with Angular. When I look at .Net Core 2.1, I can see how you can build a limited version of core with a couple View pages and serve up Angular or ReactJS pages instead. I'm looking at the Angular Demo now, and that would be too hard core for me to start with. I choose to use NPM and distribute it with Gulp and bundle it, and will try building another Angular page within a View. Summary Well that's as far as I have gotten on the subject. But once again it's another move towards shifting server CPU loads and bandwidth back to the client and use their CPU power and electricity to generate a page. Servers can just send Json formatted data. I'll find out in time if it's worth it or not, plus I have zero debate points to argue in favor of it.

                If it ain't broke don't fix it Discover my world at jkirkerx.com

                V Offline
                V Offline
                Vincent Maverick Durano
                wrote on last edited by
                #7

                jkirkerx wrote:

                notion of mixing Angular with .Net MVC

                You probably can mix Angular and ASP.NET MVC, but if you are aiming for SPA, I would suggest to just stick to Angular as your front-end and use ASP.NET Web API /ASP.NET Core Web API as your back-end. Keep in mind that ASP.NET MVC is also front-end but generates pages from the server.

                J 1 Reply Last reply
                0
                • V Vincent Maverick Durano

                  jkirkerx wrote:

                  notion of mixing Angular with .Net MVC

                  You probably can mix Angular and ASP.NET MVC, but if you are aiming for SPA, I would suggest to just stick to Angular as your front-end and use ASP.NET Web API /ASP.NET Core Web API as your back-end. Keep in mind that ASP.NET MVC is also front-end but generates pages from the server.

                  J Offline
                  J Offline
                  jkirkerx
                  wrote on last edited by
                  #8

                  I'll get to that next week to see what you mean, and if my project build is correct. But thanks for the heads up on that.

                  If it ain't broke don't fix it Discover my world at jkirkerx.com

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups