AngularJS set button text based on condition in ng-repeat

前端 未结 1 1107
日久生厌
日久生厌 2021-01-01 16:33

I\'m trying to learn Angular by converting a piece of working jQuery/AJAX code. It\'s an activity viewer inside a table that basically displays a message with a button to \'

相关标签:
1条回答
  • 2021-01-01 17:00

    I think this should do what you want:

        <button ng-click='activity.seen = !activity.seen'>
            <span>{{activity.seen ? 'Mark unread' : 'Mark read'}}</span>
        </button>
    

    Fiddle

    0 讨论(0)
提交回复
热议问题