This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,8 @@ class ComponentFactory {
322
322
shadowScope[attrName] = attrValue;
323
323
} else if (mapping == '=' ) {
324
324
ParsedFn expr = parser (attrValue);
325
- var shadowValue;
325
+ var shadowValue = expr (parentScope);
326
+ shadowScope[attrName] = shadowValue;
326
327
shadowScope.$watch (
327
328
() => expr (parentScope),
328
329
(v) => shadowScope[attrName] = shadowValue = v);
Original file line number Diff line number Diff line change @@ -456,6 +456,18 @@ main() {
456
456
expect ($rootScope.done).toEqual (true );
457
457
}));
458
458
459
+ it ('should create a component with IO and "=" binding value should be available' , inject (() {
460
+ $rootScope.name = 'misko' ;
461
+ var element = $(r'<div><io attr="A" expr="name" ondone="done=true"></io></div>' );
462
+ $compile (element)(injector, element);
463
+ var component = $rootScope.ioComponent;
464
+ expect (component.scope.expr).toEqual ('misko' );
465
+ $rootScope.$apply ();
466
+ component.scope.expr = 'angular' ;
467
+ $rootScope.$apply ();
468
+ expect ($rootScope.name).toEqual ('angular' );
469
+ }));
470
+
459
471
it ('should expose mapped attributes as camel case' , inject (() {
460
472
var element = $('<camel-case-map camel-case=6></camel-case-map>' );
461
473
$compile (element)(injector, element);
You can’t perform that action at this time.
0 commit comments