diff --git a/modules/angular2/test/core/compiler/integration_spec.js b/modules/angular2/test/core/compiler/integration_spec.js
index e3f25d0e4e..2914c366a5 100644
--- a/modules/angular2/test/core/compiler/integration_spec.js
+++ b/modules/angular2/test/core/compiler/integration_spec.js
@@ -16,6 +16,7 @@ import {BindingPropagationConfig} from 'angular2/src/core/compiler/binding_propa
import {Decorator, Component, Viewport} from 'angular2/src/core/annotations/annotations';
import {Template} from 'angular2/src/core/annotations/template';
+import {Parent, Ancestor} from 'angular2/src/core/annotations/visibility';
import {ViewContainer} from 'angular2/src/core/compiler/view_container';
@@ -296,6 +297,43 @@ export function main() {
done();
})
});
+
+ it('should create a component that injects a @Parent', (done) => {
+ tplResolver.setTemplate(MyComp, new Template({
+ inline: '
+
Component with an injected parent
', + directives: [SomeDirective] +}) +class CompWithParent { + myParent: SomeDirective; + constructor(@Parent() someComp: SomeDirective) { + this.myParent = someComp; + } +} + +@Component({ + selector: 'cmp-with-ancestor' +}) +@Template({ + inline: 'Component with an injected ancestor
', + directives: [SomeDirective] +}) +class CompWithAncestor { + myAncestor: SomeDirective; + constructor(@Ancestor() someComp: SomeDirective) { + this.myAncestor = someComp; + } +} + @Viewport({ selector: '[some-viewport]' })