material icon indicating copy to clipboard operation
material copied to clipboard

Material-input does not render scope value set in controller

Open Frank3K opened this issue 12 years ago • 9 comments

Scope values set in a controller do not render anymore when they are used in a <material-input> control. This is since the recent changes in textField.js where the $formatter function is replaced by a $viewChangeListeners and a $render function (diff).

A demo of this issue can be found in the following plunkr. The expected result is that the word World is in the input element. Tested in Firefox 32 and Chromium 37.

Frank3K avatar Sep 23 '14 19:09 Frank3K

+1 (*1,000,000)

Also, the test should be extended to check on input attr(value). This is kind of a huge regression :/ The demo includes ng-model=data.description, but in the demo controller, $scope.data = {}; is set.

maxwellium avatar Sep 25 '14 18:09 maxwellium

+1

cristiano-belloni avatar Sep 27 '14 18:09 cristiano-belloni

+1. Reverting the lines in the diff fixes it.

tomups avatar Sep 30 '14 13:09 tomups

+1

kimsrung avatar Oct 01 '14 04:10 kimsrung

Attribute "value" is needed in order to let this working properly

<material-input ng-model="name" value="{{name}}"></material-input>

but it's look duplicate.

kuyseng avatar Oct 01 '14 08:10 kuyseng

+1

rothanachoun avatar Oct 01 '14 10:10 rothanachoun

+1

scarletsky avatar Oct 02 '14 12:10 scarletsky

It should be noted that current the matches the Floating Label TextField component.

Other textfield (input) components will be added in the near future.

ThomasBurleson avatar Oct 02 '14 17:10 ThomasBurleson

Demo, css, and Sass mixins for Floating Label TextFields updated:

Fixed in SHA 63eeb4

ThomasBurleson avatar Oct 04 '14 20:10 ThomasBurleson