This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
In attribute variable inside directive, attribute does not has right value #5513
Milestone
Comments
Hi, |
http://plnkr.co/edit/n4gF2w7SI7T6HJFbUNGO?p=preview console.log("sep value:["+tAttrs.aSep+"]"); return sep value:[] instead of sep value:[ ] |
siddii
added a commit
to siddii/angular.js
that referenced
this issue
Jan 2, 2014
siddii
added a commit
to siddii/angular.js
that referenced
this issue
Jan 2, 2014
Created a plunkr for the fix from my local build - http://plnkr.co/edit/ai1CKh?p=preview |
Thank you so much |
Narretz
pushed a commit
to Narretz/angular.js
that referenced
this issue
Jun 8, 2016
BREAKING CHANGE: White-space in attributes is no longer trimmed automatically. This includes leading and trailing whitespace, and attributes that are purely white-space. This allows developers to use white-space in their attributes, for example as value for input[type=radio], as a separator in ngList, or as a value in any custom directive binding. To migrate, attributes that require trimming must now be trimmed manually. A common cases where stray white-space can cause problems is when attribute values are compared, for example in an $observer: ``` $attrs.$observe('myAttr', function(newVal) { if (newVal === 'false') ... }); ``` Note that `$parse` trims expressions automatically, so attributes with expressions (e.g. directive bindings) are unlikely to be affected by stray white-space. Fixes angular#5513 Fixes angular#14539 Closes angular#5597 ngList test
Narretz
pushed a commit
to Narretz/angular.js
that referenced
this issue
Jun 8, 2016
BREAKING CHANGE: White-space in attributes is no longer trimmed automatically. This includes leading and trailing whitespace, and attributes that are purely white-space. This allows developers to use white-space in their attributes, for example as value for input[type=radio], as a separator in ngList, or as a value in any custom directive binding. To migrate, attributes that require trimming must now be trimmed manually. A common cases where stray white-space can cause problems is when attribute values are compared, for example in an $observer: ``` $attrs.$observe('myAttr', function(newVal) { if (newVal === 'false') ... }); ``` Note that `$parse` trims expressions automatically, so attributes with expressions (e.g. directive bindings) are unlikely to be affected by stray white-space. Fixes angular#5513 Fixes angular#14539 Closes angular#5597 ngList test
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When i create my directive to use with autoNumeric, try to use variable attr inside compile function, like this:
compile: function(tElm, tAttrs)
So, problem is, when i put in html data-a-sep attribute with value " " (space), when i try to get this value from directive by using this:
tAttrs.aSep it returns me empty, NOT a SPACE.
As for me - it`s a bug. Or i miss something?
Thanks a lot.
The text was updated successfully, but these errors were encountered: