Comments (8)
Hi Jarek.
I'm not sure I've understood what you mean. :(
Would you mind explaining it in more detail to me? I'll appreciate it.
from ngtagsinput.
Let's say I'd like to pass a placeholder as an expression.
Now it's not possible.
We could develop some kind of initial checking and if value passed is valid expression then evaluate it. Or make it a scope variable
from ngtagsinput.
Oh, I get it now. Thanks for clarifying it.
You can pass an expression to all options - placeholder
included - as long as you wrap it up with {{ ... }}
. Take a look at this Plunker script.
There's a caveat, though. Any expression is evaluated only once, when the directive is loaded. That's by design, since I believe directive's options aren't supposed to change after they are initialized. That may change in future versions if it turns out to be a bad design choice.
from ngtagsinput.
Exactly - that's what I noticed.
In my project I need to get placeholder translated and for translations we use http://l20n.org/ which translates strings in realtime.
On regular basis we use https://github.com/EE/ng-l20n to manage translations keys in templates instead of in controllers. To use it I'd have to be able to set custom properties on actual <input>
. Since there's no way to transfer properties from <tags-input>
to <input>
for now I patched ngTagsInput for my own usage: added attribute to <input>
itself.
Wrapping up: both bindable options and attribute transferring (selective, I guess - which I hope to find some time and try to implement) would solve my problem.
from ngtagsinput.
Ok, I understand now why you need to dynamically change the input placeholder. :)
You're not the first one trying to do that. I have added support for expressions in options precisely because another user had reported he needed to translate the placeholder text in runtime. But unlike you, he was using a custom filter to accomplish that, so a simple expression did the trick (placeholder="{{ value | translate }}"
).
Your idea of "attribute transferring" is kind of interesting, though. I'll think more about it.
from ngtagsinput.
translate as a filter does not apply here since l20n does not translate strings. It does translate nodes.
Event better design choice would be to make ngTagsInput an attribute directive and keep original input - then you won't have to struggle rebinding events (not my case here, but I had this problem somewhere else).
But it's not a point of this feature request.
from ngtagsinput.
From the very beginning ngTagsInput was intended to be used as a new HTML element. I wouldn't consider changing it into an attribute for the input tag unless that becomes a critical requirement. But who knows what the future holds? :)
If you run into more troubles, please let me know.
from ngtagsinput.
I just wanted to make sure that during current project development if (when) I'd send some pull requests extending ngTagsInput functionality those pull requests will follow your main idea as much as possible (or at least won't break it). Otherwise I'll focus on developing features I need on my fork and then we'll try to find some common part of it some time later.
from ngtagsinput.
Related Issues (20)
- autocomplete dropdown is behind keyboard on mobile HOT 1
- Dynamic minTags or required field? HOT 1
- Hebrew support
- How can I clear the $query value after I have added a tag
- Object passed to on-tag-added with use-strings="true"
- Cannot set HTML maxlength attribute to input field HOT 1
- change the color when a tag item is clicked
- I am not able to update the ng-model from controller.
- Change value of autocomplete on input field
- Binding to min-tags and max-tags
- [Urgent] Is this Plugin available in Angular 2+ version? HOT 1
- Disable focus input
- Paste in ng-tags-input is not working on MAC. HOT 1
- prevent ng-tags-input from removing tag on backspace HOT 1
- Not able to disable the scrolling when the mouse is hovering the list item HOT 1
- Autocomplete debounce-delay is broken with long-running requests HOT 2
- After adding 1st tag remove the focus from the input box. HOT 2
- Not compatible with breeze as it is
- allow-dblclick-to-edit not working in ng-repeat
- Open to CSS update to remove browser warnings? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngtagsinput.