Closed nl0 closed 11 years ago
I'm just guessing here, but maybe this is caused by the order in which directives are handled because the priority of them changed? https://github.com/angular/angular.js/blob/master/CHANGELOG.md#breaking-changes
@nl0 you are seeing side effects of https://github.com/angular/angular.js/commit/63c5334c84b7269428c710226764d1f08a36e0d4
This is not something we can remedy in this project, the final fix needs to come from the AngularJS itself.
What you can do on your side is to move ngIf into a wrapper div. But I'm not sure what is the advantage of doing alerts filtering on the DOM level via ngIf. Couldn't you do this on the data level and filter out alerts with empty messages?
Closing for now as this is something that needs to be fixed in the AngularJS.
@pkozlowski-opensource ok, alerts may be not a perfect example, but tabs are, imo.
If i have a <tabset>
with <tab>
s inside, and i want to show only some of them based on some condition -- the wrapper divs are not an option, the only option is to use ngShow
instead of ngIf
, but ngIf
makes more sense in this case (to take these unneeded tabs out of the dom altogether).
I understand that the fix should come from the angular itself, but maybe you could direct me to some workaround?
Currently the only workaround is 1.2.0rc2. It works on rc2.
but datepicker doesnt work on rc2 =)
aha, works for me actually. But I guess I have done some significant changes to it on my end.
@nl0 unfortunatelly this is not something we can remedy in this project. If 2 directives are asking for transclusion on the same DOM element, AngularJS1.2RC3 will fail with the error. As commented by Igor this is something that needs to be solved in the AngularJS itself.
For now your only option is to move ngIf into a parent element of a directive.
ok thx
Directives that use transclusion (tested on
tab
andalert
) in conjunction withngIf
are broken on angular#1.2.0-rc.3 (though worked well on rc.2).For example
<alert type="alert.type" ng-if="alert.text">{{alert.text}}</alert>
fails with the following error:(using angular-bootstrap#0.6.0)