Commit 047d6c6c authored by colemanw's avatar colemanw
Browse files

Merge branch 'unregisterField' into 'master'

Remove unnecessary registerField process

See merge request extensions/afform!21
parents dcb835d0 e042b785
......@@ -18,7 +18,6 @@
var ts = $scope.ts = CRM.ts('afform'),
entity = _.pick($scope, _.keys(modelProps));
entity.id = null;
entity.fields = [];
afFormCtrl.registerEntity(entity);
// $scope.$watch('afEntity', function(newValue){$scope.myOptions = newValue;});
}
......
......@@ -9,10 +9,6 @@
},
link: function($scope, $el, $attr, afFormCtrl) {
$scope.afFormCtrl = afFormCtrl;
// This is faster than waiting for each field directive to register itself
$('af-field', $el).each(function() {
afFormCtrl.registerField($scope.modelName, $(this).attr('name'));
});
},
controller: function($scope){
this.getDefn = function getDefn() {
......
......@@ -22,9 +22,6 @@
schema[entity.modelName] = entity;
data[entity.modelName] = entity.data || {};
};
this.registerField = function(entityName, fieldName) {
schema[entityName].fields.push(fieldName);
};
this.getEntity = function getEntity(name) {
return schema[name];
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment