WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 101387a

Browse files
committed
query scope method by selector
1 parent 47e1022 commit 101387a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ng-profile-scope-method.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
where $scope could be determined from element 'my-selector'
99
*/
1010
(function profileScopeMethod() {
11-
var selector = 'find';
11+
var selector = '#find';
1212
var methodName = 'find';
1313
var name = selector + ':' + methodName;
1414

1515
/* global angular */
16-
var el = angular.element(document.getElementById(selector));
16+
var el = angular.element(document.querySelector(selector));
1717
var scope = el.scope() || el.isolateScope();
1818
console.assert(scope, 'cannot find scope from ' + name);
1919

0 commit comments

Comments
 (0)