{"id":2511,"date":"2019-03-11T10:00:26","date_gmt":"2019-03-11T14:00:26","guid":{"rendered":"http:\/\/www.mymiller.name\/wordpress\/?p=2511"},"modified":"2019-05-11T18:36:47","modified_gmt":"2019-05-11T22:36:47","slug":"angular-environment","status":"publish","type":"post","link":"https:\/\/www.mymiller.name\/wordpress\/angular\/angular-environment\/","title":{"rendered":"Angular Environment"},"content":{"rendered":"\n<p>Building a website for today and tomorrow begins with Angular.  Yes I am a proponent of Angular over many other client frameworks.  Let&#8217;s look over the goals of this post to help you get started.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Node.js<\/li><li>Angular-Cli<\/li><li>Angular Workspace <\/li><li>Angular Material<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Node.js<\/h3>\n\n\n\n<p><g class=\"gr_ gr_5 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep\" id=\"5\" data-gr-id=\"5\">First<\/g> step you need to do is to install the latest version of Node.js.  This is a simple step click on this link <a href=\"https:\/\/nodejs.org\/en\/\"><a href=\"https:\/\/nodejs.org\/en\/\">https:\/\/nodejs.org\/en\/<\/a><\/a> to download the installer for your system.  I recommended the LTS over the Current Latest. Run the install and complete installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Angular-Cli<\/h3>\n\n\n\n<p>Installing and using Angular-Cli for your development will download the latest version of Angular for your project and help in creating components, libraries, and applications.  To install Angular-Cli open your command prompt and enter the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g @angular\/cli<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up your Angular Workspace<\/h3>\n\n\n\n<p><g class=\"gr_ gr_5 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep\" id=\"5\" data-gr-id=\"5\">First<\/g> step is to create your Angular Workspace.  Two ways to create your angular workspace.  Use the following command to create a workspace with an application name <em>foo<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ng new foo<\/code><\/pre>\n\n\n\n<p>Now if you want to create an Angular Library, then you need to create your workspace without an application, then create your library, and finally create your test application.  Follow these steps, for a library named <em><g class=\"gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del\" id=\"4\" data-gr-id=\"4\">foo<\/g><\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ng new foo --create-application=false\ncd foo\nng generate library foo-lib --prefix=foo\nng generate application foo-tester<\/code><\/pre>\n\n\n\n<p>Your foo-lib and foo-tester will be located under a projects directory, located directly under foo.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Angular Material<\/h3>\n\n\n\n<p>Angular Material provides excellent components and theming support to build your application on.  It keeps pace with Angular to take advantage of new features.  To install Angular Material from your foo directory run the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install --save @angular\/material @angular\/cdk @angular\/animations\nnpm install --save hammerjs<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Configuring Angular Material in your application<\/h4>\n\n\n\n<p>In your FooAppModule you need to add support for BrowserAnimationsModule.  Add the following import lines to your module:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import {BrowserAnimationsModule} from '@angular\/platform-browser\/animations';\n\n@NgModule({\n  ...\n  imports: [BrowserAnimationsModule],\n  ...\n})\nexport class FooAppModule { }<\/code><\/pre>\n\n\n\n<p>Next  you need to add in your component modules:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { MatToolbarModule, MatButtonModule, MatSidenavModule, MatIconModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule } from '@angular\/material';\nimport { MatAutocompleteModule, MatCheckboxModule, MatDatepickerModule, MatFormFieldModule, MatInputModule, MatRadioModule } from '@angular\/material';\nimport { MatSelectModule, MatSliderModule, MatSlideToggleModule, MatDividerModule, MatExpansionModule } from '@angular\/material';\nimport { MatStepperModule, MatTabsModule, MatTreeModule, MatButtonToggleModule, MatBadgeModule, MatChipsModule } from '@angular\/material';\nimport { MatProgressSpinnerModule, MatProgressBarModule, MatRippleModule, MatBottomSheetModule, MatDialogModule } from '@angular\/material';\nimport { MatSnackBarModule, MatTooltipModule, MatPaginatorModule, MatSortModule, MatTableModule } from '@angular\/material';\n\n@NgModule({\n  ...\n  imports: [BrowserAnimationsModule,\n    MatToolbarModule,\n    MatButtonModule,\n    MatSidenavModule,\n    MatIconModule,\n    MatListModule,\n    MatGridListModule,\n    MatCardModule,\n    MatMenuModule,\n    MatAutocompleteModule,\n    MatCheckboxModule,\n    MatDatepickerModule,\n    MatFormFieldModule,\n    MatInputModule,\n    MatRadioModule,\n    MatSelectModule,\n    MatSliderModule,\n    MatDividerModule,\n    MatStepperModule,\n    MatTabsModule,\n    MatTreeModule,\n    MatButtonToggleModule,\n    MatBadgeModule,\n    MatProgressSpinnerModule,\n    MatProgressBarModule,\n    MatRippleModule,\n    MatBottomSheetModule,\n    MatDialogModule,\n    MatSnackBarModule,\n    MatTooltipModule,\n    MatPaginatorModule,\n    MatSortModule,\n    MatTableModule,\n  ],\n  ...\n})\nexport class FooAppModule{ }<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Theme Configuration<\/h4>\n\n\n\n<p><g class=\"gr_ gr_7 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep\" id=\"7\" data-gr-id=\"7\">Next<\/g> you need to configure a theme.  You can use one of the pre-built <g class=\"gr_ gr_6 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace\" id=\"6\" data-gr-id=\"6\">one<\/g> to begin and later change to <g class=\"gr_ gr_5 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-del replaceWithoutSep\" id=\"5\" data-gr-id=\"5\">a custom<\/g> if you wish.  You can add one of the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>deeppurple-amber.css<\/li><li>indigo-pink.css<\/li><li>pink-bluegrey.css<\/li><li>purple-green.css<\/li><\/ul>\n\n\n\n<p>To do this add the following to your styles.css line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@import \"~@angular\/material\/prebuilt-themes\/purple-green.css\"<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Adding Gesture Support<\/h4>\n\n\n\n<p>You already downloaded and installed hammerjs which provides you with gesture support.  This is used by some of the material components.  To enable, in your src\/main.ts fille add the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'hammerjs';<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Adding Material Icons<\/h4>\n\n\n\n<p>You need to add in the Material Design Icons. To do this add the following line to your index.html for your application:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;link href=\"https:\/\/fonts.googleapis.com\/icon?family=Material+Icons\" rel=\"stylesheet\"><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Building your Library<\/h3>\n\n\n\n<p>If you did a library in your workspace you need to do the following to build it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd food\nng build foo-lib<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Using your Library<\/h3>\n\n\n\n<p>Now if you wish to use your library, in your application import in your module into:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { FooLibModule } from 'foo-lib';\n\n@NgModule({\n  ...\n  imports: [\n     FooLibModule,\n     ...\n  ],\n  ...\n})\nexport class FooAppModule{ }<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Starting your Application<\/h3>\n\n\n\n<p>To start serving your application run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ng serve --open<\/code><\/pre>\n\n\n\n<p>This will have your application listening on <a href=\"http:\/\/localhost:4200\/\">http:\/\/localhost:4200\/<\/a> and open your browser to this address for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Building a website for today and tomorrow begins with Angular. Yes I am a proponent of Angular over many other client frameworks. Let&#8217;s look over the goals of this post to help you get started. Node.js Angular-Cli Angular Workspace Angular Material Installing Node.js First step you need to do is to install the latest version [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2515,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[281],"tags":[269,270],"series":[283],"class_list":["post-2511","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-angular","tag-angular","tag-material","series-angular"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2019\/03\/geometry-1023846_640.jpg?fit=640%2C359&ssl=1","jetpack-related-posts":[{"id":3811,"url":"https:\/\/www.mymiller.name\/wordpress\/angular\/streamline-your-workflow-generate-angular-services-from-spring-boot-rest-apis-with-gradle\/","url_meta":{"origin":2511,"position":0},"title":"Streamline Your Workflow: Generate Angular Services from Spring Boot REST APIs with Gradle","author":"Jeffery Miller","date":"February 24, 2025","format":false,"excerpt":"Integrating your Angular frontend with a Spring Boot backend can be a breeze if you automate the process of creating your Angular services. This post will show you how to leverage Gradle, OpenAPI (Swagger), and the OpenAPI Generator to generate type-safe Angular TypeScript services directly from your Spring Boot REST\u2026","rel":"","context":"In &quot;Angular&quot;","block_context":{"text":"Angular","link":"https:\/\/www.mymiller.name\/wordpress\/category\/angular\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif 3x"},"classes":[]},{"id":2940,"url":"https:\/\/www.mymiller.name\/wordpress\/angular\/tips-tricks-for-an-angular-material-library\/","url_meta":{"origin":2511,"position":1},"title":"Tips\/Tricks for an Angular Library","author":"Jeffery Miller","date":"December 21, 2020","format":false,"excerpt":"Tips and tricks for building an Angular Material Library.","rel":"","context":"In &quot;Angular&quot;","block_context":{"text":"Angular","link":"https:\/\/www.mymiller.name\/wordpress\/category\/angular\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/start-2465624_640.jpg?fit=640%2C425&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/start-2465624_640.jpg?fit=640%2C425&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/start-2465624_640.jpg?fit=640%2C425&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2657,"url":"https:\/\/www.mymiller.name\/wordpress\/angular\/angular-material-grid-layout-responsive\/","url_meta":{"origin":2511,"position":2},"title":"Angular Material Grid Layout Responsive","author":"Jeffery Miller","date":"December 16, 2019","format":false,"excerpt":"Angular Material is a powerful extension onto Angular for UI design. I personally fell in love with it before I ever used it. When I started using it I knew I would find things I would want to improve. Material Grid List is so handy to use and makes layouts\u2026","rel":"","context":"In &quot;Angular&quot;","block_context":{"text":"Angular","link":"https:\/\/www.mymiller.name\/wordpress\/category\/angular\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2019\/12\/grid-684983_640.jpg?fit=640%2C480&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2019\/12\/grid-684983_640.jpg?fit=640%2C480&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2019\/12\/grid-684983_640.jpg?fit=640%2C480&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2946,"url":"https:\/\/www.mymiller.name\/wordpress\/angular\/angular-material-checkbox\/","url_meta":{"origin":2511,"position":3},"title":"Angular Material Checkbox","author":"Jeffery Miller","date":"January 11, 2021","format":false,"excerpt":"Create a compnent for Display\/Edit of a checkbox using Angular Material mat-form-field.","rel":"","context":"In &quot;Angular&quot;","block_context":{"text":"Angular","link":"https:\/\/www.mymiller.name\/wordpress\/category\/angular\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/checklist-2549229_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/checklist-2549229_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/checklist-2549229_640.jpg?fit=640%2C426&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3029,"url":"https:\/\/www.mymiller.name\/wordpress\/angular\/angular-material-loading-spinner\/","url_meta":{"origin":2511,"position":4},"title":"Angular Material Loading Spinner","author":"Jeffery Miller","date":"May 3, 2021","format":false,"excerpt":"Just about every project I need to have at least one loading spinner to indicate to the user that data is being loaded and to wait. My recent project I found that to be no exception. I wanted to come up with something that I thought was a little nicer\u2026","rel":"","context":"In &quot;Angular&quot;","block_context":{"text":"Angular","link":"https:\/\/www.mymiller.name\/wordpress\/category\/angular\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2943,"url":"https:\/\/www.mymiller.name\/wordpress\/angular\/angular-material-string-component\/","url_meta":{"origin":2511,"position":5},"title":"Angular Material String Component","author":"Jeffery Miller","date":"January 4, 2021","format":false,"excerpt":"Create a compnent for Display\/Edit\/Delete of a string using Angular Material mat-form-field.","rel":"","context":"In &quot;Angular&quot;","block_context":{"text":"Angular","link":"https:\/\/www.mymiller.name\/wordpress\/category\/angular\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/application-1883453_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/application-1883453_640.jpg?fit=640%2C426&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2020\/12\/application-1883453_640.jpg?fit=640%2C426&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/2511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/comments?post=2511"}],"version-history":[{"count":6,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/2511\/revisions"}],"predecessor-version":[{"id":2519,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/2511\/revisions\/2519"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media\/2515"}],"wp:attachment":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media?parent=2511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/categories?post=2511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/tags?post=2511"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/series?post=2511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}