ionic-content-banner icon indicating copy to clipboard operation
ionic-content-banner copied to clipboard

banner with no text

Open ohadgk opened this issue 9 years ago • 4 comments

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.

ohadgk avatar Oct 10 '15 11:10 ohadgk

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!

djett41 avatar Oct 12 '15 08:10 djett41

I got the same issue

Carniatto avatar Oct 29 '15 12:10 Carniatto

This seems to happen if the text param is a string, not an array.

AgDude avatar Nov 17 '15 23:11 AgDude

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.

trazek avatar Dec 16 '15 18:12 trazek