ionic-content-banner
ionic-content-banner copied to clipboard
banner with no text
Hello, in some cases a banned showes up withut any text or "X" button in it, just empty red/greay. has anyone encountered it? I cant find where the problem is.
Hmm never seen that, Can you reproduce it in the demo or another repo / codepen? If you have something I can reproduce I can look at it Thanks!
I got the same issue
This seems to happen if the text
param is a string, not an array.
I experience this issue even when passing in a text array with one value:
contentBanner = $ionicContentBanner.show({
text: ["WOOOOOOOOT"],
interval: 3000,
autoClose: 100000,
type: 'info',
transition: 'vertical'
});
This results in a the following markup:
<ion-content-banner class="content-banner info content-banner-transition-vertical content-banner-in"><div class="content-banner-text-wrapper"><!-- ngRepeat: item in text track by $index --></div><button class="content-banner-close button button-icon icon {{::icon}}" ng-click="close()"></button></ion-content-banner>
Notice the ngRepeat is empty.
If I click the area where the close button should be, the text and close button appear as the banner is closing. Seems to be a problem with text arrays of 1 element. Also, if there are two elements, I am experiencing the second item sometimes displays first.
My use case is to display a content-banner as a response captured by $scope.$on(...); I think could be a digest cycle problem. I apologize for the numerous edits as I am working this issue right now, trying to figure it out
Final update: I had to wrap my call in a $scope.$apply(function() {...}) and it worked as intended. Hopefully this chain of events helps someone.