1

I can't access an object property in AngularJS view. Simple but very crazy issue.

Here is a fiddle: Fiddle

Code below. operators.date and operators.boolean are not available in AngularJS view. How do I access the property?

$scope.operators = {
    date: {'$lt':'before', '$gt':'after', '$eq':'equals'},
    boolean: {'$eq': 'is'},
    all : ['before', 'after', 'contains', 'does not contain', 'equals' ]
};
2
  • 1
    See stackoverflow.com/questions/12648543/…. This is an issue with the property names starting with $. When using the {{ }} directive, angular will not show nested $ variables. And in general the team warns against using variables beginning with $. Commented May 26, 2013 at 17:08
  • thanks, it's working. If you want add it as an answer :) Commented May 26, 2013 at 17:19

1 Answer 1

2

As commented above, this is an issue with the property names starting with $. When using the {{ }} directive, angular will not show nested $ variables. And in general the team warns against using variables beginning with $. See AngularJS and its use of Dollar Variables

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.