G
G
GiperScriper2015-03-02 11:35:26
Angular
GiperScriper, 2015-03-02 11:35:26

Values ​​for checkboxes, ng-true-value doesn't understand value from scope?

From the angular documentation:

Examples of non-constant expressions include:

<input type="checkbox" ng-model="..." ng-true-value="someValue">
<input type="checkbox" ng-model="..." ng-false-value="{foo: someScopeValue}">

it is necessary to set true-false values ​​for checkboxes, it understands constants, but when setting ng-true-value="ValueObject.myValue", it swears, although this option is described in the documentation, Angular version 1.3.14, if anyone came across, I will be glad to advice how to solve this problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
re5pawn, 2015-05-09
@re5pawn

Try wrapping ValueObject.myValue in curly double brackets ng-true-value="{{ValueObject.myValue}}".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question