aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive/ngIfSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/directive/ngIfSpec.js')
-rwxr-xr-xtest/ng/directive/ngIfSpec.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/ng/directive/ngIfSpec.js b/test/ng/directive/ngIfSpec.js
index 3173f476..427bfd59 100755
--- a/test/ng/directive/ngIfSpec.js
+++ b/test/ng/directive/ngIfSpec.js
@@ -148,6 +148,34 @@ describe('ngIf', function () {
});
+describe('ngIf 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-if="true"><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('ngIf animations', function () {
var body, element, $rootElement;