validation - How to initiate an action to `component` from `Router` -
in page, router
taking care of page transition. before go next page, validate form
fields. use cp-validation
addon.
but when next button clicked, ask child component validation , send result router
. how this?
i tried validate model within router
not works. if try not correct way please let me know correct approach handle scenario.
my router bhs:
<div class="balanceemi rdc-scroll-content has-subheader rdc-view"> {{cs2i-select-tenure selectedcreditcard=model}}//my component //which requie know form validation </div> <div class="rdc-view___footer rdc-view___footer---stickey"> {{rdc-button default="cancel" type="secondary" action="redirect"}} {{#if enablenext}} {{rdc-button default="next" type="primary" action="gotonext"}} {{else}} {{rdc-button default="next" type="primary" disabled="true"}} {{/if}} <div class="formvalidatebeforenextbtn" {{action 'formvalidatebeforenext'}}>//let actin call component validaiton else le tme know correct way <!-- empty validation button--> </div> </div>
i recommend registering validate component factory, can call wherever in application router.
read ember.js docs here
Comments
Post a Comment