{"id":2463,"date":"2018-10-02T10:35:54","date_gmt":"2018-10-02T05:05:54","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2463"},"modified":"2018-10-12T15:46:40","modified_gmt":"2018-10-12T10:16:40","slug":"angular-2-installation","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/angular-2-installation\/","title":{"rendered":"Angular 2 installation"},"content":{"rendered":"<p>ANGULAR 2 INSTALLATION STEPS<br \/>\nStep 1.Download the node and install on your local machine using this link <strong>https:\/\/nodejs.org\/en\/<\/strong>.<\/p>\n<p><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/node-image.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-2583 aligncenter\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/node-image.png\" alt=\"\" width=\"590\" height=\"419\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/node-image.png 590w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/node-image-300x213.png 300w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/a><\/p>\n<p>Step 2. To install the Angular CLI:<br \/>\n<strong><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">npm install -g @angular\/cli<\/code><\/strong><\/p>\n<p>Step 3. Check the version of node and npm that also use to check whether installed or not.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-19-at-11.38.47-PM.png\"><img decoding=\"async\" class=\" wp-image-2582 aligncenter\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-19-at-11.38.47-PM.png\" alt=\"\" width=\"640\" height=\"549\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-19-at-11.38.47-PM.png 1170w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-19-at-11.38.47-PM-300x257.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-19-at-11.38.47-PM-768x659.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-19-at-11.38.47-PM-1024x879.png 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Step 4. Generating and serving an Angular project via a development server Create and run a new project:<\/p>\n<p><strong><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">ng new project_name<\/code><\/strong><\/p>\n<p><strong><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">cd path_of_project<\/code><\/strong><\/p>\n<p><strong><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">                               ng serve<\/code><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Step 5. Use this link <strong>http:\/\/localhost:4200\/<\/strong> to check whether the project has been working or not. The app will automatically reload if you change any of the source files.<\/p>\n<p>Step 6. Install mysql using this link <strong>https:\/\/dev.mysql.com\/downloads\/mysql\/<\/strong> and install.<\/p>\n<p><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-20-at-12.00.55-AM.png\"><img decoding=\"async\" class=\"wp-image-2585 aligncenter\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-20-at-12.00.55-AM.png\" alt=\"\" width=\"642\" height=\"440\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-20-at-12.00.55-AM.png 2030w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-20-at-12.00.55-AM-300x206.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-20-at-12.00.55-AM-768x527.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/Screen-Shot-2018-09-20-at-12.00.55-AM-1024x702.png 1024w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/a><\/p>\n<p>Step 7. Check whether the node and npm has been installed successfully without any error.<br \/>\n<strong>\u00a0 <\/strong><strong><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">node -v<\/code><\/strong><\/p>\n<p><strong>\u00a0 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">npm -v<\/code><\/strong><\/p>\n<p>Step 8. Make sure that npm has been installed globally. Using\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">npm install -g @angular\/cli\u00a0<\/code>without -g npm will not install globally.<\/p>\n<p>Step 9. Create a new Angular 2 project. <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">ng new project_name<\/code>. (This will probably take a few minutes belongs to the system performance.)<\/p>\n<p>Step 10. Create a new component by using the command of<br \/>\n<strong><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">ng generate component [component-name]<\/code><\/strong><\/p>\n<p>Step 11. Executing the command creates a folder, [component-name], in the project&#8217;s src\/app path or the current path the command is executed in if it&#8217;s a child folder of the project. The folder has the following:<br \/>\n<strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[component-name].component.ts the component class file\r\n[component-name].component.css for styling the component\r\n[component-name].component.html component html\r\n[component-name].component.spec.ts tests for the component\r\nIndex.ts<\/pre>\n<p>which exports the component<\/p>\n<p>Step 12. Do the design in the\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[component-name].component.html\u00a0<\/code>file for the interface.<\/p>\n<p>Step 13. Add the css design to the html interface using\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[component-name].component.css<\/code><\/p>\n<p>Step 14. Use the angular scripting to do the back end process which has been done on the html page using the<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[component-name].component.ts.<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Step 15. Import all the header files which are necessary to compile the project. If any one of the header files is missing its not compile the project.<\/p>\n<p>Step 16. Use database which one you want and I am using mysql gives the DB connection for this we have to use the php file in the document root to mention the in my local machine the path is \/Library\/Webserver\/Documents.<\/p>\n<p>Step 17. Create the new php file and do the php connection in this file. If the connection is done we can able to push the data to the database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ANGULAR 2 INSTALLATION STEPS Step 1.Download the node and install on your local machine using this link https:\/\/nodejs.org\/en\/. Step 2. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[],"class_list":["post-2463","post","type-post","status-publish","format-standard","hentry","category-web-architecture","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-DJ","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2463"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2463\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}