Skip to content

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

@franciscohanna92

Description

@franciscohanna92

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions