Issue
I just started to work with Angular, it seems good to implement and I am enjoying it.
I just used ternary operator in my HTML
page, but it's not working and I am getting Angular parsing error
Here is the stuff which I am trying to execute.
<button class="common btnYellow viewAllText">{{data.data.bookmarks[0].category_name.length>=0 ? '{{data.data.bookmarks[0].category_name}}' : 'Recently Added'}}</button>
What can I try next?
Solution
Replace this:
{{data.data.bookmarks[0].category_name.length>=0 ? '{{data.data.bookmarks[0].category_name}}' : 'Recently Added'}}
With this:
{{data.data.bookmarks[0].category_name.length>=0 ? data.data.bookmarks[0].category_name : 'Recently Added'}}
<button class="common btnYellow viewAllText">{{data.data.bookmarks[0].category_name.length>=0 ? data.data.bookmarks[0].category_name : 'Recently Added'}}</button>
Answered By - Bhojendra Rauniyar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.