‘post’ only refers to a type, but is being used as a value here

I am getting errors in this component.ts file at push(post). the error is 'post' only refers to a type, but is being used as a value here.

import { Component } from '@angular/core';
import { post } from './comp/list/list.module';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
spost:post[]=[];

onpostadd(){
  this.spost.push(post);
}
}

this is the model.ts file

export interface post {

  title: string;
  content : string;

}


Read more here: https://stackoverflow.com/questions/68487430/post-only-refers-to-a-type-but-is-being-used-as-a-value-here

Content Attribution

This content was originally published by Gurcharan Singh at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: