Created
May 29, 2020 17:42
-
-
Save hotsoft-desenv4/94188f496294dfecdfe98cd0b9b7288f to your computer and use it in GitHub Desktop.
This file contains 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
rsvp.js:23 Uncaught TypeError: selfthis.redirectTo is not a function | |
at marcas-form.js:14 | |
at tryCatcher (rsvp.js:335) | |
at invokeCallback (rsvp.js:506) | |
at publish (rsvp.js:492) | |
at rsvp.js:16 | |
at invoke (backburner.js:335) | |
at Queue.flush (backburner.js:226) | |
at DeferredActionQueues.flush (backburner.js:423) | |
at Backburner._end (backburner.js:957) | |
at Backburner.end (backburner.js:707) |
This file contains 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
app/components/marcas/marcas-form.js | |
import Component from '@glimmer/component'; | |
import { action } from '@ember/object'; | |
import { tracked } from '@glimmer/tracking'; | |
export default class MarcasFormComponent extends Component{ | |
@tracked redirectTo; | |
//https://guides.emberjs.com/v3.3.0/components/triggering-changes-with-actions/ | |
//https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/closure-actions.md | |
@action | |
saveMarca(marca) { | |
let selfthis = this; | |
marca.save().then( function() { | |
selfthis.redirectTo(); | |
}); | |
} | |
} |
This file contains 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
app/controllers/marcas/new.js | |
import Controller from '@ember/controller'; | |
import { action } from '@ember/object'; | |
export default class MarcasNewController extends Controller { | |
@action | |
redirectTo() { | |
this.transitionToRoute("/marcas"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment