Click here to Skip to main content
14,920,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have the below data from api call:

        "newsCategory": "Corporate",
        "newsHead": "header data",
        "newsDate": "20-01-2020",
        "newsContent": "something comkdnf"
        "newsCategory": "hjhds",
        "newsHead": "hjkhbksd",
        "newsDate": "20-01-2020",
        "newsContent": "jhvjchddnf"

how to bind this data to component.html page in angular.
even with NgFor loop also fine

What I have tried:

/////Some elements are there in html.

constructor(public _newsService : NewsService) { }

ngOnInit(): void {
       (news : allNewsArray[])=>{console.log(typeof(newsdetails[0]))}

export class allNewsArray {​​​​​​​​
newsCategory: string;
newsHead: string;
newsDate: string;
newsContent: string;
Updated 31-Oct-20 22:35pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900