{"id":51,"date":"2018-08-26T01:41:00","date_gmt":"2018-08-26T01:41:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/2018\/08\/26\/angularjs-tutorial-for-beginners-2-how-to-set-up-angularjs\/"},"modified":"2020-07-25T22:13:55","modified_gmt":"2020-07-25T20:13:55","slug":"angularjs-tutorial-for-beginners-2-how-to-set-up-angularjs","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/angularjs-tutorial-for-beginners-2-how-to-set-up-angularjs\/","title":{"rendered":"AngularJS Tutorial For Beginners 2: How to Set up AngularJS"},"content":{"rendered":"<p>In this tutorial, we would set up AngularJS and test it to make sure it works. We would do this is 7 simple steps. I would recommend you try to follow along. Also leave a comment if you have any challenges.<\/p>\n<p>&nbsp;<\/p>\n<p><b>Step 1<\/b>: Open Notepad<\/p>\n<p><b>Step 2<\/b>: Paste the code below into notepad<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #557799;\">&lt;!doctype html&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;html<\/span> <span style=\"color: #0000cc;\">ng-app<\/span><span style=\"color: #007700;\">&gt;<\/span>\r\n  <span style=\"color: #007700;\">&lt;head&gt;<\/span>\r\n    <span style=\"color: #007700;\">&lt;title&gt;<\/span>KTG AngularJS Tutorial<span style=\"color: #007700;\">&lt;\/title&gt;<\/span>\r\n    <span style=\"color: #007700;\">&lt;script <\/span><span style=\"color: #0000cc;\">src=<\/span><span style=\"background-color: #fff0f0;\">\"https:\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/1.5.6\/angular.min.js\"<\/span><span style=\"color: #007700;\">&gt;&lt;\/script&gt;<\/span>\r\n  <span style=\"color: #007700;\">&lt;\/head&gt;<\/span>\r\n  <span style=\"color: #007700;\">&lt;body&gt;<\/span>\r\nMy First Program\r\n  <span style=\"color: #007700;\">&lt;\/body&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/html&gt;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><b>Step 3<\/b>: Save with\u00a0 a name test.html (you can choose another name, but it must end in .html).<\/p>\n<p><b>Step 4:<\/b> Open the location you\u00a0 saved the file. Right-click and open the file in internet explorer<br \/>\nIf it displays a web page with the text KTG AngularJS Tutorial, the congrat. If not, let me know in the comment box below.<\/p>\n<p>In this setup we have used\u00a0 the CDN link for AngularJS. CDN means content delivery network, which hosts the angular.js file.<br \/>\nNow you need to download a copy of angular.js file to your computer and replaces the CDN link in the head with the link to the file you downloaded. So let&#8217;s continue in step 5.<\/p>\n<p><b>Step 5<\/b>: Click on this link to <a href=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/1.7.2\/angular.min.js\" target=\"_blank\" rel=\"noopener\">download angularJS<\/a> &#8211;\u00a0 and place it in the same folder as the file we create in step 2.<\/p>\n<p>Now the folder should contain two files<\/p>\n<ul>\n<li>angular.min.js<\/li>\n<li>test.html<\/li>\n<\/ul>\n<p><b>Step 6<\/b>: Open the test.html file in notepad and replace the script tag with this one:<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"line-height: 125%; margin: 0;\"><span style=\"color: #007700;\">&lt;script <\/span><span style=\"color: #0000cc;\">src=<\/span><span style=\"background-color: #fff0f0;\">\"angular.min.js\"<\/span><span style=\"color: #007700;\">&gt;&lt;\/script&gt;<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><b>Step 7:<\/b> Save the changes and test the file again by opening it in Internet explorer (chrome or Firefox or any other browser)<br \/>\nIf it open the web page and displays the same message as before then you are good to go.<\/p>\n<p>&nbsp;<\/p>\n<p><b>Download Notepad++<\/b><br \/>\n<b><\/b>We could actually continue using notepad, but just to make it a bit easier for us, we would be using Notepad++ in subsequent tutorials. <a href=\"https:\/\/notepad-plus-plus.org\/downloads\/\">Download Notepad++ from here.<\/a><br \/>\n<a href=\"https:\/\/www.blogger.com\/\"><br \/>\n<\/a>Thank for your effort.<\/p>\n<p>Now you can continue to <a href=\"https:\/\/kindsonthegenius.com\/blog\/angularjs-tutorial-for-beginners-3-your-first-angularjs-application-interesting\/\">Tutorial 3 &#8211; Write your First Script in AngularJS<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we would set up AngularJS and test it to make sure it works. We would do this is 7 simple steps. I &hellip; <\/p>\n","protected":false},"author":1,"featured_media":496,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[113],"tags":[],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/51"}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":7,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":1027,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/51\/revisions\/1027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media\/496"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}