Skip to content

Commit ebe0de8

Browse files
committed
Eval expression in man sf-schema directive
Needed for new bootrstrap decorators condition
1 parent 426f936 commit ebe0de8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/directives/schema-form.js

+12
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ angular.module('schemaForm')
147147
// let it be.
148148
scope.externalDestructionInProgress = true;
149149
});
150+
151+
/**
152+
* Evaluate an expression, i.e. scope.$eval
153+
* but do it in parent scope
154+
*
155+
* @param {String} expression
156+
* @param {Object} locals (optional)
157+
* @return {Any} the result of the expression
158+
*/
159+
scope.evalExpr = function(expression, locals) {
160+
return $scope.$parent.$eval(expression, locals);
161+
};
150162
}
151163
};
152164
}

0 commit comments

Comments
 (0)