Forked from Gaurav0/components.change-password-form\.js
Last active
September 16, 2020 14:17
-
-
Save harikr2006/fe472b55748d9c62af5e942d1f0c018b to your computer and use it in GitHub Desktop.
EMber jtest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Component from '@glimmer/component'; | |
| import { tracked } from '@glimmer/tracking'; | |
| import { action } from '@ember/object'; | |
| export default class extends Component { | |
| @tracked oldPassword; | |
| @tracked newPassword; | |
| @tracked confirmPassword; | |
| @action | |
| changeOldPassword(ev) { | |
| this.oldPassword = ev.target.value; | |
| } | |
| @action | |
| changeNewPassword(ev) { | |
| this.newPassword = ev.target.value; | |
| } | |
| @action | |
| changeConfirmPassword(ev) { | |
| this.confirmPassword = ev.target.value; | |
| } | |
| @action | |
| changePassword(ev) { | |
| // Prevent the form's default action. | |
| ev.preventDefault(); | |
| console.log(this.args); | |
| debugger; | |
| this.args.changePassword({ | |
| oldPassword: this.oldPassword, | |
| newPassword: this.newPassword, | |
| confirmPassword: this.confirmPassword | |
| }); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Component from '@glimmer/component'; | |
| import { tracked } from '@glimmer/tracking'; | |
| import { action } from '@ember/object'; | |
| export default class extends Component { | |
| @tracked op; | |
| @tracked np; | |
| @tracked cp; | |
| @action | |
| oldPassword(ev){ | |
| this.op = ev.target.value; | |
| } | |
| @action | |
| newPassword(ev){ | |
| this.np = ev.target.value; | |
| } | |
| @action | |
| cnfPassword(ev){ | |
| this.cp = ev.target.value; | |
| } | |
| @action | |
| triggerComponent(ev){ | |
| ev.preventDefault(); | |
| this.args.test(); | |
| // this.args.changePasswordController({ | |
| // oldpassword:this.op, | |
| // newpassword:this.np, | |
| // cnfpassword:this.cp | |
| // }) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Controller from '@ember/controller'; | |
| export default Controller.extend({ | |
| actions: { | |
| changePasswordController(attrs) { | |
| console.log('I am a controller',attrs); | |
| }, | |
| test(){ | |
| console.log("test"); | |
| } | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import EmberRouter from '@ember/routing/router'; | |
| import config from './config/environment'; | |
| const Router = EmberRouter.extend({ | |
| location: 'none', | |
| rootURL: config.rootURL | |
| }); | |
| Router.map(function() { | |
| this.route('change-password'); | |
| }); | |
| export default Router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Route from '@ember/routing/route'; | |
| export default class extends Route { | |
| model() { | |
| return { | |
| oldPassword: '', | |
| newPassword: '', | |
| confirmPassword: '' | |
| }; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.17.1", | |
| "EmberENV": { | |
| "FEATURES": {}, | |
| "_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false, | |
| "_APPLICATION_TEMPLATE_WRAPPER": true, | |
| "_JQUERY_INTEGRATION": true | |
| }, | |
| "options": { | |
| "use_pods": false, | |
| "enable-testing": false | |
| }, | |
| "dependencies": { | |
| "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js", | |
| "ember": "3.18.1", | |
| "ember-template-compiler": "3.18.1", | |
| "ember-testing": "3.18.1" | |
| }, | |
| "addons": { | |
| "@glimmer/component": "1.0.0" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment