Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access form object in component's controller #175

Open
franciscohanna92 opened this issue Nov 1, 2018 · 1 comment
Open

Can't access form object in component's controller #175

franciscohanna92 opened this issue Nov 1, 2018 · 1 comment

Comments

@franciscohanna92
Copy link

I have a form like:

<!-- myTemplate.html -->
<form name="myForm">
...
</form>

And the controller like:

import template from './myTemplate.html';

export const MyForm = {
    template,
    controller: class MyForm {
        ...
    }
}

When I try to access this.myForm in a controller method I get that it's undefined. I've also tried to name the form with $ctrl.myForm in the template but with no luck (base on the best answer in this question on SO)

I'm using webpack4 to compile.

@khyamay
Copy link

khyamay commented Nov 6, 2018

Interesting, I can access the this.myForm by following the best answer in that question on SO and I am using webpack4 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants