我很难选择有角度的元素。我一定犯了一些愚蠢的错误:
function Root($scope) {
$scope.elem = angular.element('div');
}
导致的错误:
Error: selectors not implemented
at Error (<anonymous>)
at Object.JQLite [as element] (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js:1523:13)
at new Root (http://fiddle.jshell.net/kzX9z/7/show/:28:27)
at invoke (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js:2795:28)
at Object.instantiate (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js:2805:23)
at $get (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js:4621:24)
at $get.i (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js:4200:17)
at forEach (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js:117:20)
at nodeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js:4185:11)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js:3834:14) angular.js:5563
$get angular.js:5563
$get angular.js:4661
$get.Scope.$apply angular.js:7890
SNAKE_CASE_REGEXP angular.js:930
invoke angular.js:2788
bootstrap angular.js:928
angularInit angular.js:904
(anonymous function) angular.js:14397
trigger angular.js:1695
event.preventDefault angular.js:1930
forEach angular.js:110
eventHandler
我究竟做错了什么?我包括了 jQuery。这不应该工作吗?