[英]show and hide footer and footer message
我正在尝试使用Intel XDK创建一个角度应用程序,在这里运行索引页面时我们会看到页脚消息。 我需要的是每5秒显示和隐藏页脚消息
index.html
<div class="bar bar-footer bar-balanced" style="background-color:#444444;">
<div class="title">{{footer_message}}</div>
</div>
您可以使用角度$ interval或window.setInterval函数
$interval(function() {
if($scope.showFooter)
{
$scope.showFooter =false;
}
else{$scope.showFooter =true;}
},5000);
注意:您必须在控制器中注入$ interval服务
在您的html中:
<div ng-show="showFooter" class="bar bar-footer bar-balanced" style="background-color:#444444;">
<div class="title">{{footer_message}}</div>
</div>
您可以在控制器页面中使用$ interval()并在索引页面中使用ng-show
我认为您正在foorter message。中寻找通知部分,因此您可以做的是在$ scope。$ watch服务中绑定message变量,并检查该消息变量是否具有某些值,以及该消息是否具有某些值,请立即将其设为null html部分使用该变量的ng-show
$timeout(function () {
$scope.footerMessage = null;
}, 2000);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.