@@ -280,6 +280,7 @@ void main() {
280
280
describe ('components' , () {
281
281
beforeEachModule ((Module module) {
282
282
module
283
+ ..bind (AttachWithAttr )
283
284
..bind (CamelCaseMapComponent )
284
285
..bind (IoComponent )
285
286
..bind (IoControllerComponent )
@@ -654,6 +655,15 @@ void main() {
654
655
expect (logger).toEqual (['SimpleAttachComponent' ]);
655
656
}));
656
657
658
+ it ('should call attach after mappings have been set' , async ((Logger logger) {
659
+ _.compile ('<attach-with-attr attr="a" oneway="1+1"></attach-with-attr>' );
660
+
661
+ _.rootScope.apply ();
662
+ microLeap ();
663
+
664
+ expect (logger).toEqual (['attr' , 'oneway' , 'attach' ]);
665
+ }));
666
+
657
667
it ('should inject compenent element as the dom.Element' , async ((Logger log, TestBed _, MockHttpBackend backend) {
658
668
backend.whenGET ('base/test/core_dom/foo.html' ).respond ('<div>WORKED</div>' );
659
669
_.compile ('<log-element></log-element>' );
@@ -1205,6 +1215,19 @@ class SimpleAttachComponent implements AttachAware, ShadowRootAware {
1205
1215
onShadowRoot (_) => logger ('onShadowRoot' );
1206
1216
}
1207
1217
1218
+ @Decorator (
1219
+ selector: 'attach-with-attr'
1220
+ )
1221
+ class AttachWithAttr implements AttachAware {
1222
+ Logger logger;
1223
+ AttachWithAttr (this .logger);
1224
+ attach () => logger ('attach' );
1225
+ @NgAttr ('attr' )
1226
+ set attr (v) => logger ('attr' );
1227
+ @NgOneWay ('oneway' )
1228
+ set oneway (v) => logger ('oneway' );
1229
+ }
1230
+
1208
1231
@Component (
1209
1232
selector: 'log-element' ,
1210
1233
templateUrl: 'foo.html' )
0 commit comments