Coder Social home page Coder Social logo

Comments (2)

lavinjj avatar lavinjj commented on June 13, 2024

It sounds as if the element.key is not matching the value being passed into as value. What is happening in the code you posted above is angular walks each item in the localize.dictionary array and checks to see if the element.key matches the passed in value and adds it to a result array that is returned from the call to $filter.

You can set a break point in the browser on the line return element.key === value; and should see it doing the comparison.

Hope this helps.

from angularjs-localizationservice.

nilsawesome avatar nilsawesome commented on June 13, 2024

Huge thanks for your answer :)

I'm using Firefox 24.0 and Firebug. If i set a checkpoint on "return element.key === value;" it doesn't stop there. If I set the checkpoint on the line above and start debugging, it doesn't reach the line either.

edit:
I'm using data-i18n="welcomeHeader" right now to call the service and the following language file:

[
{
"key":"welcomeHeader",
"value":"Welcome to CASCADE",
"description":"Home page greeting text"
},
{
"key":"loginButton",
"value":"Log In",
"description":"login button text"
}
]

The value which is compared with element.key is welcomeHeader

from angularjs-localizationservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.