How to host an angularjs app in domain

前端 未结 4 1516
无人及你
无人及你 2021-01-31 02:07

Currently Learning to create a simple AngularJs App.

This is my first MVC app, so my questions may be very basic.

  1. I understand that we require nodejs t

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-31 02:25

    AngularJS doesn't require node.js to work, you can even use it from the google CDN without having the script hosted on your server. Node.js is used mostly for the testing, like if you want to do e2e test with Karma for example. It's a good point if you have it, but you can host an app on a simple server without node.js, and test it locally for example

    Actually, any server on the internet (a good old apache for example) will be able to host an angular app, as all the work will be done on the client side

    Node.js, however, is required for the question 3. Yeoman (the Yo command), grunt and bower are part of the workflow sometimes used to build an angular app. But, these are not required either. It allows you to create quickly a skeleton for a new app, test it an deploy it. It's explained on their website, http://yeoman.io/

    Those tools require node.js to work, but they're not a requirement for an angular app to work. It can be useful to have them somewhere if you plan on building many angular app in the future, but you will be able to host thoses apps even without any of these tools.

    How to host your angular app ? Like any other HTML page. You can even copy this code and save it to your hard drive :

    
    
      
    
    
      {{"hello"+" world"}}
    
    
    

    then open it, it will work !

提交回复
热议问题