Delete by Object Id angular 2 and mongodb
<p>I am trying to delete Posts from a comments section in my web app. Mongodb passes an objectId but I am unable to get it from my angular 2 front end. By default ObjectId is passed as <code>_id</code> so on my front end I call <code>Post._id</code> in my delete function and it passes through all this info </p>

<p><a href="https://i.stack.imgur.com/CGBhC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CGBhC.png" alt="enter image description here"></a></p>

<p>what I actually want is the unique ObjectId given by the database itself that look like this </p>

<p><a href="https://i.stack.imgur.com/1j9Ad.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1j9Ad.png" alt="enter image description here"></a></p>

<p>How can I get this value on the front end of my application? I have all the code to my project on github located <a href="https://github.com/bcrawford11/Angular2-w-CRUD-Api-MongoDb" rel="nofollow noreferrer">here</a> with both my UI and API backend. Thanks for any help!</p>

<p><strong>relative files from repo</strong></p>

<ul>
<li>UI/src/app/components - PostData.Service.ts</li>
<li>UI/src/app/components -postRand.component.ts</li>
<li><p>UI/src/app/components/models - Post.ts</p></li>
<li><p>API/src/controllers - PostAPIController.cs</p></li>
<li>API/src/models - Post.cs</li>
<li>API/src/models - DataAccess.cs</li>
</ul>

<p><strong>API Running</strong></p>

<p><a href="https://i.stack.imgur.com/6nvwI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6nvwI.png" alt="enter image description here"></a></p>

<p>I believe I need to make this fix in the api layer because it is passing my <code>_id</code> as an object and not a string... This is just a guess of mine and I am not sure how to do this.</p>