angular-typewrite icon indicating copy to clipboard operation
angular-typewrite copied to clipboard

input type="text" ?

Open n3tx opened this issue 8 years ago • 2 comments

Hi Antonio,

I am trying to get the angular-typewrite directive work on a input textbox, but it's not working. Should it be working ?

I tried using it on a span and it works, except for the start attribute, I am trying to trigger a restart by changing the value on the start attribute. I have even tried to remove and add the start attribute on the span as well.

What I am trying to accomplish is, when the textbox have focus then the placeholder text is showing, but when the textbox is blured then typewriter should be restarted.

I am using angular 1.5.

Hope you can help med out.

n3tx avatar Nov 24 '16 14:11 n3tx

Hi @n3tx ,

Currently there's no support for input tags. However the Use Case you're describing seems a bit particular. What I mean is that I guess you can accomplish your desired effect playing a bit with markup.

Have you tried playing with positioning absolutely a span with the directive and hide/show it depending on the state of the input focus/value?

Cheers

antoniocapelo avatar Nov 24 '16 19:11 antoniocapelo

Hi Antonio,

thanks for your answer.

Yes, that's how I solved it.

But I still got problem with the start attribute, I can't start or stop it through code, only in markup.

I am using angular 1.5 (component) with TypeScript. Maybe is something with the scope.$watch ?

I have googled some, and it looks like angular 1.5 doesn't support watchers. So you have to use ng-change event to get it working in angular 1.5.

Thanks

n3tx avatar Nov 24 '16 21:11 n3tx