0

I want to learn AngularJs from http://www.tutorialspoint.com/angularjs but an example must be deployed a server. I don't know anything about it.

Please give me some hint about deploy .htm extension file to a server. Example url is following;

http://www.tutorialspoint.com/angularjs/angularjs_includes.htm

java.nazif
  • 539
  • 1
  • 8
  • 17
  • You should probably learn HTML first, and see how you can run these html files that you create on your local computer. you'll learn that you don't need server for client side languages like html or javascript(angular is essentially a javascript framework). – Mridul Kashyap Jul 27 '16 at 06:43
  • Mridul Kashyap Thanks for your advice .But I know html but this example different from others so that I ask this question.If you examine example you will see and understand issue. – java.nazif Jul 27 '16 at 06:47
  • in the example you gave, it says the 2 ways given at the top are used to embed html within another html page. it also says "Using AngularJS, we can embedded HTML pages within a HTML page using ng-include directive.". so do you want to try the server side methodologies as well before trying angular to embed the html within an html page? – Mridul Kashyap Jul 27 '16 at 06:54
  • @MridulKashyap you should see foolowing statements end of page :Output To run this example, you need to deploy textAngularJS.htm, main.htm and subjects.htm to a webserver. Open textAngularJS.htm using url of your server in a web browser. See the result. – java.nazif Jul 27 '16 at 07:28
  • 1
    make a folder on your desktop. put all three files in it. double click the `tryAngularJS.htm`. it should work. – Mridul Kashyap Jul 27 '16 at 07:30
  • I tried but it doesnt work.. :) – java.nazif Jul 27 '16 at 07:33
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/118388/discussion-between-mridul-kashyap-and-skynafo). – Mridul Kashyap Jul 27 '16 at 07:34

3 Answers3

1

I believe that they just mean placing the files somewhere inside the web root. The web root should be deployed by your local or remote server.

Example: Download and install MAMP. Set your root directory as the MAMP root directory in preferences. Now you can use your own paths -- just follow the example in the link you provided.

https://www.mamp.info/en/

Also, I'm of the opinion that it's good practice to at least use a local web server as opposed to running your website without one.

ketchupisred
  • 631
  • 3
  • 16
  • Thanks for your idea..But I think we dont need to download it because I have tomcat..Unfortunately I can' t deploy it to tomcat.. – java.nazif Jul 27 '16 at 07:32
  • See this question here for a basic tomcat setup: http://stackoverflow.com/questions/3954621/deploying-just-html-css-webpage-to-tomcat – ketchupisred Jul 27 '16 at 07:46
0

You don't need a webserver to test the code given in that example. ng-include using relative paths works fine. However, if you really want to use a webserver for other examples/projects, depending upon your OS, you can use *AMP. where * means

W for windows L for linux

once you have it installed, place the files in www folder. and access it in browser using http://localhost

Mridul Kashyap
  • 684
  • 5
  • 11
  • I question this: *W for windows L for linux and M for Mac* as MAMP is for Windows as well. MAMP stands for: My Apache - MySQL - PHP – ketchupisred Jul 27 '16 at 07:44
  • @ketchupisred There. Fixed it. – Mridul Kashyap Jul 27 '16 at 07:46
  • Why do we meed PHP and MySQL? The files are static pages. – vincent163 Jul 27 '16 at 07:58
  • 1. The OP required that the files be served via a server -- but didn't specify which kind until later. 2. MAMP is very easy to install and use compared to other servers that I've tried so that's why I recommended it. No one mentioned anything about utilizing PHP and MySQL; it just so happens that they are part of the MAMP package. – ketchupisred Jul 27 '16 at 08:22
0

Firstly I add my app folder under

D:\tomcat7\apache-tomcat-7.0.67-windows-x64\apache-tomcat-7.0.67\webapps

after I run tomcat server . And run

http://localhost:8080/an/ht.htm It is working :) Thanks @ketchupisred @Mridul Kashyap

java.nazif
  • 539
  • 1
  • 8
  • 17