Skip to content

mcInput haven't [name] binding #94

Closed
1 of 3 tasks
evilfant opened this issue Feb 21, 2019 · 3 comments
Closed
1 of 3 tasks

mcInput haven't [name] binding #94

evilfant opened this issue Feb 21, 2019 · 3 comments
Assignees

Comments

@evilfant
Copy link
Contributor

I'm submitting a

  • bug
  • feature request
  • question

What is the current behavior?
If I set [name] binding to mcInput it's not passed to input element

If the current behavior is a bug, please provide the steps to reproduce it

// component.ts
...
nameField: string = 'some-name';
...
<!-- template.html -->
<mc-form-field>
        <input [name]="nameField" mcInput [(ngModel)]="value" type="text">
</mc-form-field>

2019-02-21 10 26 22

What is the expected behavior?
[name] binding is passed to input element, it should generate

<input class="mc-input ng-pristine ng-valid ng-touched" mcinput="" type="text" name="some-name" ng-reflect-name="some-name" ng-reflect-model="" ng-reflect-type="text" id="mc-input-0">

Please tell us about your environment:

  • Mosaic version: 1.0.0-beta.0
  • Browser: all

Other information

@imrekq
Copy link
Member

imrekq commented Feb 21, 2019

In this case, name is attribute and isn't property. See Attribute Binding and Attribute vs. Property.

@evilfant
Copy link
Contributor Author

ok, but

<input [name]="nameField">

works fine, and

<input mcInput [name]="nameField">

not working

@lskramarov
Copy link
Contributor

because
[name]="nameField" is binding
and
name="nameField" is attribute
I think you have to read information given by @imrekb

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

No branches or pull requests

3 participants