17
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AngularJS と jQuery を併用するとき

Posted at

AngularJSのソースをちょっと覗いたときに気がついたのですが、angular.element の実体は通常 jQueryLite なんですが、window.jQuery が設定されてる(jQuery読みこまれてる)と、jQueryを拡張して、angular.element にするんですね!

ドキュメントに書いてなかったよーなと思ってドキュメント見たら、ちゃんと書いてありましたw

angular.module("mymodule", []).directive("foo", ->
	{
		restrict: 'CA'
		link: (scope, element, attrs)->
			nexts = jQuery(element).nextAll()
			#ごにょごにょ
			return
	}
)

とか書いてたところは

angular.module("mymodule", []).directive("foo", ->
	{
		restrict: 'CA'
		link: (scope, element, attrs)->
			nexts = element.nextAll()
			#ごにょごにょ
			return
	}
)

って形に直そう...

17
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?