如何添加导航栏按钮具有离子开/离子断功能 [英] How to adding navigation bar button having ionic-on/ ionic-off functionality

查看:120
本文介绍了如何添加导航栏按钮具有离子开/离子断功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要添加导航栏,当该用户preSS,按钮显示选中的图标,并在下一次是preSS它显示未选中的星号按钮。
我尝试了用离子式和离子过,但我不能做到这一点。

I want to add star button on navigation bar and when user press on this, the button show selected icon and next time is press it show unselected. I tried it by using ionic-on and ionic-off but I can't make it.

推荐答案

图标上图标关闭属性只适用于标签,我认为。您可以使用纳克级像你在这里看到。根据您的 $ scope.starred 属性的值,它会显示一个明星或明星的轮廓。

The icon-on and icon-off attributes only apply to tabs I think. You can use ng-class like you see here. Based on the value of your $scope.starred property, it will show a star or the outline of a star.

<span class="icon" ng-class="{'ion-ios-star': starred, 'ion-ios-star-outline': !starred}"></span>

这篇关于如何添加导航栏按钮具有离子开/离子断功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆