M.hussnain Gujjar
M.hussnain Gujjar

Reputation: 1

Angular conditional date pipe

I want to format createdDate using date pipe which is coming from an api, and render in my html template how can this be done?

The api response looks like:

Json:

    {
        "id":18, 
        "firstName":"Zeeshi", 
        "lastName":"Mughal", 
        "userName":"zeeshi", 
        "email":"[email protected]", 
        "emailVerified":0, 
        "phone":"+92307886689", 
        "phoneVerified":0, 
        "role":"Employee",
        "createdDate":"2021-11-30T06:12:51.000Z"
    }

Html:

    <div class="first-name" 
        *ngFor="let profileinfo of profileinfo | keyvalue">
        <h2>
            <span class="info-color">{{profileinfo.key}}</span>
        </h2>
        <p>
            {{ profileinfo.value}}
        </p>
    </div>
 

Upvotes: 0

Views: 139

Answers (0)

Related Questions