10秒ごとにhttpコールを行い、rootScope.mailSentがtrueの場合はdivを表示します。呼び出しはうまくいっています。
<div ng-show="{{mailSent === true}}" class="pastille" ng-cloak=""></div>
をしかしmailSent値がtrueであるのに対し、divが表示されません:私の見解では
$interval(function(){
$http.get("/api/sentMails")
.then(function(response) {
if (response.data.length>0){
$rootScope.mailSent = true;
}
});
}.bind($rootScope), 10000);
を:
私のコントローラでは、私はそれを行っています。 何か不足していますか?
をあなたは 'NG-show'で{{}}' '必要はありません。 。 –
リクエストが完了するたびにconsole.log($ rootScope.mailSent)を試しましたか? –
そしてyes @MuliYulzaryは正しく、 'ng-show'に' {{}} 'は不要です –