You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Building a directive that takes a date string for an attribute. If bound to a Date object, the interpolated value passed to the $observe/$watch function is an ISO string surrounded by double quotes.
Markup:
<my-directive today="{{selectedDate}}"/>
link method:
attrs.$observe('today', function(val) { opts.today = new Date(val); });
Value of 'val' received in function and viewed in console looks like:
""2016-02-12T22:59:26.630Z""
This can be resolved with opts.today = new Date(eval(val)) but it would be necessary to see if someone actually supplied a static string date for the attribute instead of a bound object by checking for a leading quote.