I have a simple directive which shows notification, user can tap on it to close it. its not working as expected (once hide by user its not showing again) in ionic, and same thing it working on angular only.
Here is directive code
angular.module('app').directive('notificationBar', [function(){
return {
restrict : 'A',
scope : {
msg : '@',
type : '@',
show : '='
},
template : '<div ng-click="hideIt()" ng-show="show" class="alert {{type}}"><span>×</span> {{ msg }}</div>',
link : function ( scope, elem, attr ) {
scope.type = attr.type || 'alert-danger';
scope.hideIt = function () {
scope.show = false;
};
// for debugging
scope.$watch('show', function(newValue, oldValue) {
console.info('old show val', oldValue);
console.info('new show val', newValue);
});
}
};
}]);