ng-input icon indicating copy to clipboard operation
ng-input copied to clipboard

ng-model, ng-change attributes are getting applied to <span> not <input>

Open jimishio opened this issue 8 years ago • 3 comments

Hey @cesardeazevedo, I have been using this ngInput tag for my form elements in my angular application.

Now issue is when I apply any ng-model or ng-change properties/attributes to tag, It gets applied to element which is getting created by ng-input.js.

For any change or for getting any value from input box, I need to refer to that particular ng-model value and I need ng-change function as input value gets changed some behaviour should be changed too.

I tried editing ng-input.js but I came accross more errors, which I am not able to solve right now.

Please help.

jimishio avatar Aug 19 '15 05:08 jimishio

They are copied to input and remains to spans. There's a button on the first theme at demo page, take a look http://cesardeazevedo.github.io/ng-input/

and which angular version you're using?

cesardeazevedo avatar Aug 19 '15 06:08 cesardeazevedo

yeah I saw that button. But somehow ng-model, ng-change are going to span tag only. even properties like maxlength (I don't know if you support this or not) are going to span tag only.

I am using 1.4.0 version of angular.

jimishio avatar Aug 19 '15 09:08 jimishio

It supports only this properties https://docs.angularjs.org/api/ng/directive/input from angular input docs.

This is wierd because the input tag is already defined with all default properties, which is a reference from properties defined in the ng-input tag, see the code https://github.com/cesardeazevedo/ng-input/blob/master/src/ng-input.html#L2-L12

i've seen some problems with ng-change, that i'm taking a look.

cesardeazevedo avatar Aug 19 '15 15:08 cesardeazevedo