Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 70e4280

Browse files
committed
Don't use jquery where it's not necessary
1 parent b7aede2 commit 70e4280

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/directives/schema-form.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ function($compile, schemaForm, schemaFormDecorators){
5555
transclude(scope,function(clone){
5656
clone.addClass('schema-form-ignore');
5757
element.prepend(clone);
58-
element.find('[ng-model]').each(function(){
59-
var key = this.getAttribute('ng-model');
60-
//skip first part before .
61-
ignore[key.substring(key.indexOf('.')+1)] = true;
62-
});
63-
58+
var models = element[0].querySelector('[ng-model]')
59+
if (models){
60+
for (var i=0; i < models.length; i++){
61+
console.log(i, el);
62+
var key = this.getAttribute('ng-model');
63+
//skip first part before .
64+
ignore[key.substring(key.indexOf('.')+1)] = true;
65+
}
66+
}
6467
});
6568
//Since we are dependant on up to three
6669
//attributes we'll do a common watch

src/services/decorators.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,4 @@ angular.module('schemaForm').provider('schemaFormDecorators',['$compileProvider'
255255
//Create a default directive
256256
createDirective('sfDecorator');
257257

258-
}]);
258+
}]);

0 commit comments

Comments
 (0)