-
Notifications
You must be signed in to change notification settings - Fork 248
Regression: Custom filters no longer work with ng-bind-html directive #571
Comments
It seems from code that => or <=> bindings are eval()'ed with default filter map which is empty implying we can no longer use filters when binding variables i.e < tag attr="expr | filter" > no longer works if the expr is eval'ed. Stuff like ng-repeat works because (I think) it is passed as an attr. The workaround I could come up with was to avoid using filter notation but instead inject the filter to my custom directive and do call(value) prior to setting the inner html. |
I've run into this as well. Here's a repro: https://dl.dropboxusercontent.com/u/6706310/ng_filter_repro.zip |
Unfortunately, I'm unable to run tests so I'm not going to submit a PR until I can. Not sure if this warrants a new issue since there are already a few with regards to tests, so see my comments in #547. |
PR to fix this #580 |
Angular Version: 0.9.7. I am not sure what previous version I was using when this used to work but it broke sometime in the last 2-3 weeks.
Using custom filter with ng-bind-html directive causes the following error:
No NgFilter: test_filter found!
STACKTRACE:
#0 _DefaultFilterMap.call (package:angular/core/parser/syntax.dart:210:17)
#1 Filter.eval (package:angular/core/parser/eval.dart:30:29)
#2 DynamicExpression.eval (package:angular/core/parser/dynamic_parser.dart:51:30)
#3 DynamicExpression.eval (package:angular/core/parser/dynamic_parser.dart:52:7)
#4 Compiler.createMappings... (package:angular/core_dom/compiler.dart:181:42)
#5 relaxFnArgs2. (package:angular/utils.dart:50:47)
#6 Scope._digestComputeLastDirty (package:angular/core/scope.dart:562:30)
#7 Scope._digestWhileDirtyLoop (package:angular/core/scope.dart:489:52)
#8 Scope.$digest (package:angular/core/scope.dart:475:28)
#9 _autoDigestOnTurnDone (package:angular/core/scope.dart:153:14)
#10 _rootRun (dart:async/zone.dart:710)
#11 _ZoneDelegate.run (dart:async/zone.dart:440)
#12 NgZone._finishTurn (package:angular/core/zone.dart:91:21)
#13 NgZone._onRunBase (package:angular/core/zone.dart:56:43)
#14 _onRun (package:angular/core/zone.dart:61:15)
#15 _ZoneDelegate.run (dart:async/zone.dart:440)
#16 _CustomizedZone.run (dart:async/zone.dart:650)
#17 NgZone.run (package:angular/core/zone.dart:143:27)
#18 ngBootstrap (package:angular/bootstrap.dart:87:18)
#19 main (http://127.0.0.1:3030/SandBox/web/sandbox.dart:26:14)
Here's a simple app to reproduce the issue on Dart Editor/Dartium:
sandbox.html:
The text was updated successfully, but these errors were encountered: