angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

Problems with ng-repeat and custom directive in the same element when using jQuery

Open xtang opened this issue 12 years ago • 6 comments

Dear angular guys,

Overview of the issue: After including jQuery, the scope arg and element.scope() is different in link function when using ng-repeat and custom directive in the same element.

Angular Version(s): 1.1.0, 1.2.0, 1.2.17.

Browsers and Operating System: Tested on chrome, mac os.

Reproduce the error: plunker here

Any ideas?

xtang avatar Sep 17 '14 00:09 xtang

I believe this is the issue with comment nodes not being able to have data associated with them in jquery, off the top of my head. However, the directive link functions are still called with the correct scopes, so it's not broken in that sense.

caitp avatar Sep 17 '14 08:09 caitp

Also note that angular 1.2.x does not support jQuery 2.0 --- this problem is not reproducible in angular 1.3

caitp avatar Sep 17 '14 08:09 caitp

http://plnkr.co/edit/4K8yIqUvji41L87EZunT?p=preview working as expected with supported jQuery 1.10.2

caitp avatar Sep 17 '14 08:09 caitp

Thanks @caitp. you are right -- it's caused by jQuery2.0 with angular 1.2.x. BTW, I have to use jQuery 2.0.x to support other jQuery-related lib, so which angular 1.3 version do you suggest ?

xtang avatar Sep 17 '14 10:09 xtang

probably rc2 at this point

caitp avatar Sep 17 '14 10:09 caitp

@caitp Cool, thanks!

xtang avatar Sep 17 '14 10:09 xtang