Comments (4)
You must be using the filter?
This is due to the fact that the directive is only called once per instance where a filter is re-evaluated each time the DOM is compiled.
If you use the markup data-i18n="...", it won't continuously run
from angularjs-localizationservice.
Why? I am curious, is it a bug? Can I fix it?
from angularjs-localizationservice.
It's not a bug, what you are seeing is the digest loop in angular run every time data changes within your model. That was one of the reasons I went away from the filter because it gets called each time the digest loop is called which makes the filter a hog. As kdo mentioned above, using the directives resolves this problem, because they only update when the data int he attribute changes which is much more infrequent.
In my production code I've created several different directives to handle cases like placeholders what not to get around using the filter altogether.
Hope this helps.
from angularjs-localizationservice.
@lavinjj Thanks so much, I have switched to directive now :)
Works great ;D
from angularjs-localizationservice.
Related Issues (20)
- Fall back on default resource file when key is not present in localized resource file HOT 3
- Translating placeholder attributes HOT 1
- dictionary returns undefined HOT 2
- Dynamic model and translate HOT 1
- PRoblem with IE8 HOT 3
- Changing file extension for dictionaries from .js to .json HOT 1
- Wrong URL for resources-locale_default.js HOT 1
- HTML in JSON not rendered HOT 1
- using i18n for localization does not show translation in internet explorer (IE) 9 HOT 2
- Localization of images HOT 3
- Further thoughts and scope of localization on larger applications
- Could not able to parse French special characters HOT 4
- i18n filter HOT 8
- getLocalizedString filter returns an array!
- Not compatible with angular 1.3 HOT 1
- How to add a i18n label in a js file HOT 1
- Dynamic Dom HOT 1
- Pre-included localization .js files HOT 2
- i18nAttr not updated HOT 2
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 angularjs-localizationservice.