title: Angular component html not rendering
body: <p>If there is any additional or missing information please let me know. </p>
  
  <p>I want to make a new component in an existing angular app and I want to render that component to an existing page/component.</p>
  
  <p><strong>Problem:</strong> </p>
  
  <p>The template does not appear to be getting used.</p>
  
  <p><strong>Steps:</strong></p>
  
  <p>1)created a component with the following command:</p>
  
  <p><code>ng g c little-test</code></p>
  
  <p>2)Followed error trail/debugged</p>
  
  <p>3)got the app to run</p>
  
  <p>4) no content from html file of component</p>
  
  <p><strong>My file structure:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/1aJf5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1aJf5.png" alt="My file structure"></a></p>
  
  <p><strong>application.component.ts:</strong></p>
  
  <pre><code>import { Component, Injectable, Inject, OnInit } from '@angular/core';
  import { CareersService } from '../../services/careers.service';
  import { FormBuilder, Validators, FormGroup } from '@angular/forms';
  import { ActivatedRoute, Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
  import { SelectListItem, AppSettings } from '../../settings/app.settings';
  import { Education, HigherEducation, Language, WorkExperience, Applicant, Application } from '../../services/applicants.service';
  import { CanActivate } from '@angular/router/src/interfaces';
  import { LocationsService } from '../../services/locations.service';
  import { StateItem } from '../../models/locations.models';
  import { Location } from '@angular/common';
  
  
  @Component({
    selector: 'app-little-test',
    templateUrl: '../../little-test/little-test.component.html',
    styleUrls: ['../../little-test/little-test.component.css']
  })
  export class LittleTestComponent implements OnInit {
  
    constructor() { }
  
    ngOnInit() {
    }
  
  }
  
  
  
  @Component({
    selector: 'application-header',
    templateUrl: './applicationHeader.component.html',
    styleUrls: ['./careers.component.css']
  })
  
  export class ApplicationHeaderComponent {
    public currentStep: string = localStorage.getItem('appStep');
    public applicationStepText: string;
    public applicantDisabled: string;
    public jobDisabled: string;
    public educationDisabled: string;
    public experienceDisabled: string;
    public reviewDisabled: string;
    public selectedJobTitle: string;
    public selectedLocation: string;
    public selectedCity: string = localStorage.getItem('selectedCity');
    public selectedState: string = localStorage.getItem('selectedState');
  
    constructor(public careerService: CareersService, private app: AppSettings) {
      //this.currentStep = localStorage.getItem('appStep');
      switch (this.currentStep) {
        case 'Demographics':
          this.applicationStepText = "Demographics";
          this.applicantDisabled = "disabled";
          this.jobDisabled = "disabled";
          this.educationDisabled = "disabled";
          this.experienceDisabled = "disabled";
          this.reviewDisabled = "disabled";
          break;
        case 'ApplicantInfo':
          this.applicationStepText = "Applicant Information";
          this.jobDisabled = "disabled";
          this.educationDisabled = "disabled";
          this.experienceDisabled = "disabled";
          this.reviewDisabled = "disabled";
          break;
        case 'JobInformation':
          this.applicationStepText = "Job Information";
          this.educationDisabled = "disabled";
          this.experienceDisabled = "disabled";
          this.reviewDisabled = "disabled";
          break;
        case 'WorkHistory':
          this.educationDisabled = "disabled";
          this.reviewDisabled = "disabled";
          break;
        case 'Education':
          this.applicationStepText = "Education";
          this.reviewDisabled = "disabled";
          break;
        case 'Review':
          this.applicationStepText = "Review";
          break;
        case 'Acknowledgement':
        default:
          this.applicationStepText = "Demographics";
          this.applicantDisabled = "disabled";
          this.jobDisabled = "disabled";
          this.educationDisabled = "disabled";
          this.experienceDisabled = "disabled";
          this.reviewDisabled = "disabled";
          break;
      }
    }
  
    ngOnInit() {
      var disabled = document.getElementsByClassName('disabled');
      for (var d in disabled) {
        if (disabled[d] != null &amp;&amp; disabled[d].attributes != null) {
          disabled[d].setAttribute('routerLink', '');
          disabled[d].addEventListener('click', function (e) {
            e.preventDefault();
          });
        }
      }
    }
  }
  
  @Component({
    selector: 'demographics',
    templateUrl: 'demographics.component.html',
    styleUrls: ['careers.component.css'],
  
  })
  export class DemographicsComponent {
    public error: string = this.careerService.error;
    public form: FormGroup;
    public isLoading: boolean;
    public errorOccurred: boolean;
  
    constructor(public careerService: CareersService, private router: Router, fb: FormBuilder, private app: AppSettings, private route: ActivatedRoute) {
      this.form = fb.group({
        gender: [''],
        ethnicity: ['']
      });
  
    }
  
    ngOnInit() {
      var jobId = '';
      var csc = '';
      localStorage.removeItem(this.careerService.AccessKeyName);
      localStorage.setItem('appStep', 'Demographics');
      if (this.route.snapshot.params.csc != null &amp;&amp; this.route.snapshot.params.jobId != null) {
        localStorage.setItem("selectedJobId", this.route.snapshot.params.jobId);
        localStorage.setItem("selectedLocation", this.route.snapshot.params.csc);
        localStorage.setItem("referrer", this.route.snapshot.params.referrer);
        this.careerService.selectedJobId = this.route.snapshot.params.jobId;
        this.careerService.selectedLocation = this.route.snapshot.params.csc;
        this.getJob();
      }
      else {
        if (localStorage.getItem('selectedJobId') == null || localStorage.getItem('selectedLocation') == null ) {
          this.careerService.getSelectedLocationAndJob().subscribe(res =&gt; {
            localStorage.setItem("selectedJobId", res.jobId);
            localStorage.setItem("selectedLocation", res.csc);
            localStorage.setItem("referrer", "scis");
            if (localStorage.getItem('selectedJobId') == null || localStorage.getItem('selectedLocation') == null || localStorage.getItem('selectedLocation') == '') this.errorOccurred = true;
            this.getJob();
          });
        }
      }
    }
  
    getJob() {
  
      this.careerService.getJob(localStorage.getItem('selectedJobId'), localStorage.getItem('selectedLocation')).subscribe(res =&gt; {
        localStorage.setItem('selectedJobTitle', res.title);
        localStorage.setItem('selectedCity', res.city);
        localStorage.setItem('selectedState', res.state);
        localStorage.setItem('selectedPayRateOffset', res.payRateTypeName);
        //this.careerService.selectedPayRateOffset = res.payRateTypeName;
        this.careerService.selectedJobTitle = res.title;
        this.careerService.selectedCity = res.city;
        this.careerService.selectedState = res.state;
      });
    }
  
    startOver() {
      window.location.href = window.location.href.indexOf('localhost:') &gt; 0 ? 'http://localhost:58683/careers' : '../careers';
    }
  
    continue() {
      this.isLoading = true;
      if (this.form.controls.gender.value == '') this.form.controls.gender.setValue('Prefer Not to Say');
      if (this.form.controls.ethnicity.value == '') this.form.controls.ethnicity.setValue('Prefer Not to Say');
  
      localStorage.setItem('selectedGender', this.form.controls.gender.value);
      localStorage.setItem('selectedEthnicity', this.form.controls.ethnicity.value);
      localStorage.setItem('appStep', 'StartApplication');
      this.router.navigate(['/step/start']);
    }
  }
  
  @Injectable()
  export class ApplicationGuard implements CanActivate {
    constructor(private careerService: CareersService, private router: Router, private location: Location, private app: AppSettings) { }
    public isValid = false;
    canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
      return this.canNavigate();
    }
  
    canNavigate() {
      var currentStep = localStorage.getItem('appStep');
      if (this.location.path().includes('review') &amp;&amp; currentStep != 'Review') {
        this.router.navigate(['/step/education']);
        return false;
      }
      else if (this.location.path().includes('education') &amp;&amp; (currentStep != 'Review' &amp;&amp; currentStep != 'Education')) {
        this.router.navigate(['/step/jobinfo']);
        return false;
      }
      else if (this.location.path().includes('workhistory') &amp;&amp; (currentStep != 'WorkHistory' &amp;&amp; currentStep != 'Review' &amp;&amp; currentStep != 'Education')) {
        this.router.navigate(['/step/education']);
        return false;
      }
      else if (this.location.path().includes('jobinfo') &amp;&amp; (currentStep != 'WorkHistory' &amp;&amp; currentStep != 'Review' &amp;&amp; currentStep != 'Education' &amp;&amp; currentStep != 'JobInformation')) {
        this.router.navigate(['/step/applicantinfo']);
        return false;
      }
      else if (this.location.path().includes('applicantinfo') &amp;&amp; (currentStep != 'WorkHistory' &amp;&amp; currentStep != 'Review' &amp;&amp; currentStep != 'Education'
        &amp;&amp; currentStep != 'JobInformation' &amp;&amp; currentStep != 'ApplicantInfo')) {
        this.router.navigate(['/step/start']);
        return false;
      }
      else {
        return true;
      }
    }
  }
  
  function setCookie(name, value, days) {
    var expires = "";
    if (days) {
      var date = new Date();
      date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
      expires = "; expires=" + date.toUTCString();
    }
    window.document.cookie = name + "=" + (value || "") + expires + "; path=/";
  }
  
  function getCookie(name) {
    var nameEQ = name + "=";
    var ca = window.document.cookie.split(';');
    for (var i = 0; i &lt; ca.length; i++) {
      var c = ca[i];
      while (c.charAt(0) == ' ') c = c.substring(1, c.length);
      if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
  }
  
  function eraseCookie(name) {
    window.document.cookie = name + '=; Max-Age=-99999999;';
  }
  
  </code></pre>
  
  <p><strong>application.module.ts:</strong></p>
  
  <pre><code>import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
  import { CommonModule } from "@angular/common";
  import { FormsModule, ReactiveFormsModule } from "@angular/forms";
  import { MatCheckboxModule } from "@angular/material/checkbox";
  import { MatButtonModule } from "@angular/material/button";
  import { ApplicationRoutingModule } from "./application-routing.module";
  import { MatSelectModule } from "@angular/material";
  import { ApplicationHeaderComponent, DemographicsComponent } from "./application.component";
  //import { LittleTestComponent } from '../../little-test/little-test.component';
  
  @NgModule({
    imports: [
      CommonModule,
      FormsModule,
      ReactiveFormsModule,
      MatCheckboxModule,
      MatButtonModule,
      ApplicationRoutingModule,
      MatSelectModule,
      //LittleTestComponent
    ],
    declarations: [
      ApplicationHeaderComponent,
      DemographicsComponent,
      //LittleTestComponent,
    ],
    exports: [
      ApplicationHeaderComponent,
      DemographicsComponent,
    ],
    schemas: [CUSTOM_ELEMENTS_SCHEMA]
  })
  export class ApplicationModule {
  
  }
  
  </code></pre>
  
  <p><strong>demographics.component.html:</strong></p>
  
  <pre><code>
  
  &lt;application-header&gt;&lt;/application-header&gt;
  &lt;little-test&gt;&lt;/little-test&gt;
  &lt;div class="application-content" *ngIf="!errorOccurred"&gt;
  
    &lt;p&gt;
      &lt;strong style="margin-bottom: 30px;"&gt;
        It is the policy of SCIS Air Security to provide equal employment opportunity to all qualified applicants for employment without regard to race, color, religion, national origin, sex, age, veteran status or disability.
      &lt;/strong&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;em&gt;
        Completion of this form is voluntary and in no way affects the decision regarding your application for employment.  This form is confidential, will be used only for government record keeping and reporting purposes and will be maintained separately from your application form.
      &lt;/em&gt;
    &lt;/p&gt;
    &lt;hr /&gt;
    &lt;form [formGroup]="form" (submit)="continue()" style="padding-top: 15px;"&gt;
      &lt;div class="alert alert-danger" *ngIf="error != '' &amp;&amp; error != null"&gt;
        {{error}}
      &lt;/div&gt;
      &lt;div class="row demographics-row"&gt;
        &lt;div class="col-sm"&gt;
          &lt;div class="field-container"&gt;
            &lt;mat-form-field class="gender"&gt;
              &lt;mat-select placeholder="Gender" formControlName="gender"&gt;
                &lt;mat-option value="Prefer not to say"&gt;
                  Prefer not to say
                &lt;/mat-option&gt;
                &lt;mat-option value="Female"&gt;
                  Female
                &lt;/mat-option&gt;
                &lt;mat-option value="Male"&gt;
                  Male
                &lt;/mat-option&gt;
              &lt;/mat-select&gt;
            &lt;/mat-form-field&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="col-sm"&gt;
          &lt;div class="field-container"&gt;
            &lt;mat-form-field class="ethnicity"&gt;
              &lt;mat-select placeholder="Race / Ethnicity" formControlName="ethnicity"&gt;
                &lt;mat-option value="Prefer not to say"&gt;
                  Prefer not to say
                &lt;/mat-option&gt;
                &lt;mat-option value="Hispanic / Latino"&gt;
                  Hispanic / Latino
                &lt;/mat-option&gt;
                &lt;mat-option value="American Indian or Alaska Native"&gt;
                  American Indian or Alaska Native
                &lt;/mat-option&gt;
                &lt;mat-option value="Asian"&gt;
                  Asian
                &lt;/mat-option&gt;
                &lt;mat-option value="Black or African American"&gt;
                  Black or African American
                &lt;/mat-option&gt;
                &lt;mat-option value="Native Hawaiian or Other Pacific Islander"&gt;
                  Native Hawaiian or Other Pacific Islander
                &lt;/mat-option&gt;
                &lt;mat-option value="Caucasian / White"&gt;
                  Caucasian / White
                &lt;/mat-option&gt;
                &lt;mat-option value="Other"&gt;
                  Other
                &lt;/mat-option&gt;
              &lt;/mat-select&gt;
            &lt;/mat-form-field&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;hr /&gt;
      &lt;div class="row"&gt;
  
        &lt;div class="col-sm col-xs hidden-xs"&gt;
          &lt;button mat-button color="primary" *ngIf="isLoading" type="button"&gt;&lt;i class="fa fa-spin fa-spinner"&gt;&lt;/i&gt;&lt;/button&gt;
          &lt;button mat-button color="primary" *ngIf="!isLoading" type="submit"&gt;Proceed to Application&lt;/button&gt;
        &lt;/div&gt;
        &lt;div class="col-sm col-xs hidden-xs text-right"&gt;
          &lt;button mat-button color="danger" (click)="startOver()" type="button"&gt;Start Over&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;button mat-button color="primary" class="visible-xs" *ngIf="!careerService.isLoading" type="submit"&gt;Proceed to Application&lt;/button&gt;
      &lt;button mat-button color="primary" class="visible-xs" *ngIf="careerService.isLoading" type="button"&gt;&lt;i class="fa fa-spin fa-spinner"&gt;&lt;/i&gt;&lt;/button&gt;
      &lt;span class="fill-space" style="display: inline-block; min-width: calc(100vw - 400px);"&gt;&lt;/span&gt;
      &lt;button mat-button color="danger" class="visible-xs" (click)="startOver()" type="button"&gt;Start Over&lt;/button&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;div class="alert alert-warning" *ngIf="errorOccurred"&gt;
    &lt;h4&gt;Something went wrong retrieving the application&lt;/h4&gt;
    &lt;p&gt;
      &lt;button mat-button color="primary" (click)="startOver()" type="button"&gt;Try Again&lt;/button&gt;
    &lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>little-test-component.html</strong></p>
  
  <pre><code>&lt;div&gt;
    I am the little test
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Page Source:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/610te.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/610te.png" alt="page source"></a></p>