如果其他情况属实,则条件为ng-hide

时间:2015-08-11 13:40:47

标签: angularjs angularjs-directive

这就是网络在Chrome中显示的内容:

    currently_working: true
    from_date: "2009-02-01"
    to_date: "1971-01-01"

如何应用条件以便在“current_working”为真时隐藏“to_date”并在“currently_working”为false时显示?

    <span ng-hide="experience.currently_working == true ? Currently Working : {{experience.to_date  | date:"MMM, yyyy"}}"</span>

1 个答案:

答案 0 :(得分:0)

使用ng-bind

<span ng-bind="experience.currently_working? 'Currently Working' : experience.to_date  | date:'MMM, yyyy'" ></span>