Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(input): support constant expressions for ngTrueValue/ngFalseValue #8041

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jul 2, 2014

ngTrueValue and ngFalseValue now support parsed expressions which the parser
determines to be constant values.

BREAKING CHANGE:

Previously, these attributes would always be treated as strings. However, they
are now parsed as expressions, and will throw if an expression is
non-constant.

To convert non-constant strings into constant expressions, simply wrap them in
an extra pair of quotes, like so:

<input type="checkbox" ng-model="..." ng-true-value="'truthyValue'">

(This is an alternative solution to #5346, /CC @IgorMinar PTAL)

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#8041)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

ngTrueValue and ngFalseValue now support parsed expressions which the parser determines to be constant values.

BREAKING CHANGE:

Previously, these attributes would always be treated as strings. However, they are now parsed as
expressions, and will throw if an expression is non-constant.

To convert non-constant strings into constant expressions, simply wrap them in an extra pair of quotes, like so:

    <input type="checkbox" ng-model="..." ng-true-value="'truthyValue'">
@lgalfaso
Copy link
Contributor

lgalfaso commented Jul 2, 2014

LGTM

@IgorMinar
Copy link
Contributor

lgtm

@caitp caitp closed this in c90cefe Jul 2, 2014
ckknight pushed a commit to ckknight/angular.js that referenced this pull request Jul 16, 2014
ngTrueValue and ngFalseValue now support parsed expressions which the parser determines to be constant values.

BREAKING CHANGE:

Previously, these attributes would always be treated as strings. However, they are now parsed as
expressions, and will throw if an expression is non-constant.

To convert non-constant strings into constant expressions, simply wrap them in an extra pair of quotes, like so:

    <input type="checkbox" ng-model="..." ng-true-value="'truthyValue'">

Closes angular#8041
Closes angular#5346
Closes angular#1199
christianvuerings added a commit to christianvuerings/calcentral that referenced this pull request Oct 15, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants