From d7befa947d308744ec78e310790ad335f7df528e Mon Sep 17 00:00:00 2001 From: Sean Anteau Date: Wed, 13 Dec 2017 17:13:52 -0600 Subject: [PATCH] Adding Example of validator usage in component Adding a basic computed property to the object example that demonstrates how to get validation of non-model property via js. --- addon/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addon/index.js b/addon/index.js index 1571f0df..b4547a6f 100644 --- a/addon/index.js +++ b/addon/index.js @@ -88,7 +88,13 @@ import Validator from './validations/validator'; * }); * * export default Ember.Component.extend(Validations, { - * bar: null + * bar: null, + * barStatus: Ember.computed('bar',function(){ + * if(this.get('validations.attrs.bar.isValid')){ + * return 'The Bar is Open'; + * } + * return 'The Bar is Closed'; + * }) * }); * ``` *