[Fixed] String interpolation not working Angular 7


I am trying to display a dynamic property in my card value as below –

<div class="card-block pt-2 pb-0">
    <div class="media">
        <div class="media-body white text-left">
            <h3 class="font-large-1 mb-0">{{totalprofiles}}</h3>
                <span>Total Cost</span>
        <div class="media-right white text-right">
            <i class="icon-bulb font-large-1"></i>

The property totalprofiles is a simple number field in my component, however it doesn’t get interpolated in the card or any where in the html template. Below is the code from component

    selector: 'app-dashboard2',
    templateUrl: './dashboard2.component.html',
    styleUrls: ['./dashboard2.component.scss']

export class Dashboard2Component {
    totalprofiles = 100;

I am trying to figure out why. I am using Angular CLI version (7.0.2).

Update —

After doing multiple tries I can confirm that nothing seems wrong with the html template. I replaced the html template with the below code –


Even this doesn’t seem to be working, so I guess it is something with the component. Still trying to figure out and I will update after some more research.


This was difficult to figure out and I couldn’t find any answer, however I was able to solve the problem by creating another component and copying the template and component code from old components. Though this was more of a work-around but it did solve the problem.

Leave a Reply

(*) Required, Your email will not be published