src/ng-admin.js
function(model) {
    var fields = _.keys(model);
    var updated = {};

    _.each(fields, function(field) {
        var updatedField = {};
        var modelField = {};
        if (!(field === Object(field))) {
            updatedField.field = field;
            if (!(model[field] === Object(model[field]))) {
                modelField = { type: model[field] };
            } else {
                modelField = model[field];
            }
            updatedField = _.defaults(updatedField, modelField);
        } else {
            updatedField = field;
        }
        updated[updatedField.field] = updatedField;
    });

    return updated;
}
function(model) {
    var fields = _.keys(model);
    var updated = {};

    _.each(fields, function(field) {
        var updatedField = {};
        var modelField = {};
        if (!(field === Object(field))) {
            updatedField.field = field;
            if (!(model[field] === Object(model[field]))) {
                modelField = { type: model[field] };
            } else {
                modelField = model[field];
            }
            updatedField = _.defaults(updatedField, modelField);
        } else {
            updatedField = field;
        }
        updated[updatedField.field] = updatedField;
    });

    return updated;
}
function ( model ) { var fields = _ . keys ( model ) ; var updated = { } ; _ . each ( fields , function ( field ) { var updatedField = { } ; var modelField = { } ; if ( ! ( field === Object ( field ) ) ) { updatedField . field = field ; if ( ! ( model [ field ] === Object ( model [ field ] ) ) ) { modelField = { type : model [ field ] } ; } else { modelField = model [ field ] ; } updatedField = _ . defaults ( updatedField , modelField ) ; } else { updatedField = field ; } updated [ updatedField . field ] = updatedField ; } ) ; return updated ; }
convert model and merge with nga fields
convert model and merge with nga fields