aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive/ngRepeatSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/directive/ngRepeatSpec.js')
-rw-r--r--test/ng/directive/ngRepeatSpec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/ng/directive/ngRepeatSpec.js b/test/ng/directive/ngRepeatSpec.js
index 9dde36e7..6584f31a 100644
--- a/test/ng/directive/ngRepeatSpec.js
+++ b/test/ng/directive/ngRepeatSpec.js
@@ -1058,6 +1058,33 @@ describe('ngRepeat', function() {
});
});
+describe('ngRepeat and transcludes', function() {
+ it('should allow access to directive controller from children when used in a replace template', function() {
+ var controller;
+ module(function($compileProvider) {
+ var directive = $compileProvider.directive;
+ directive('template', valueFn({
+ template: '<div ng-repeat="l in [1]"><span test></span></div>',
+ replace: true,
+ controller: function() {
+ this.flag = true;
+ }
+ }));
+ directive('test', valueFn({
+ require: '^template',
+ link: function(scope, el, attr, ctrl) {
+ controller = ctrl;
+ }
+ }));
+ });
+ inject(function($compile, $rootScope) {
+ var element = $compile('<div><div template></div></div>')($rootScope);
+ $rootScope.$apply();
+ expect(controller.flag).toBe(true);
+ dealoc(element);
+ });
+ });
+});
describe('ngRepeat animations', function() {
var body, element, $rootElement;