Skip to content

Commit

Permalink
Eval expression in man sf-schema directive
Browse files Browse the repository at this point in the history
Needed for new bootrstrap decorators condition
  • Loading branch information
davidlgj committed Aug 11, 2015
1 parent 426f936 commit ebe0de8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/directives/schema-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ angular.module('schemaForm')
// let it be.
scope.externalDestructionInProgress = true;
});

/**
* Evaluate an expression, i.e. scope.$eval
* but do it in parent scope
*
* @param {String} expression
* @param {Object} locals (optional)
* @return {Any} the result of the expression
*/
scope.evalExpr = function(expression, locals) {
return $scope.$parent.$eval(expression, locals);
};
}
};
}
Expand Down

0 comments on commit ebe0de8

Please sign in to comment.