angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.86k stars 27.52k forks source link

When trying to present data on second window on IE - null is shown #9694

Open li-raz opened 9 years ago

li-raz commented 9 years ago

In my app I am working with several windows in which the main window opens. every window is it own angular, however my data is in the main window, when I try to present the data (mainly Date objects) on the second window , in IE i get null however in chrome it works ok. When i take this object and directly add it to the html - al ls ok, also in IE

http://plnkr.co/edit/K6Kq0KP5eFVkNLJnmwTJ?p=preview

Narretz commented 9 years ago

Hi, did you try that with vanilla javascript? Maybe it's a special restriction by IE.

li-raz commented 9 years ago

Yes I have updated the plunker document.getElementById("there").innerHTML = testt.tt.aa;

still same results

LI-RAZ ROM (T) +972 (9) 769-7129 (M) +972 (54) 995-0618 li-raz.rom@nice.commailto:li-raz.rom@nice.com www.nice.comhttp://www.nice.com/ [cid:image001.png@01CFECC2.6B2EE640]http://twitter.com/NICE_Systems/ [cid:image002.png@01CFECC2.6B2EE640] http://www.facebook.com/pages/NICE-Systems/149072782602/ [cid:image003.png@01CFECC2.6B2EE640] http://www.linkedin.com/company/nice-systems [cid:image004.png@01CFECC2.6B2EE640] http://www.nice.com/blog

[cid:image005.jpg@01CFECC2.6B2EE640]http://www.nice.com/safecity

From: Narretz [mailto:notifications@github.com] Sent: יום ב, 20 אוקטובר 2014 23:45 To: angular/angular.js Cc: Li-raz Rom Subject: Re: [angular.js] When trying to present data on second window on IE - null is shown (#9694)

Hi, did you try that with vanilla javascript? Maybe it's a special restriction by IE.

— Reply to this email directly or view it on GitHubhttps://github.com/angular/angular.js/issues/9694#issuecomment-59836460.

Narretz commented 9 years ago

It works when you use .toString() in the scope assignment. Hmm.

li-raz commented 9 years ago

I didn’t really wanted to go to this solution ……

LI-RAZ ROM (T) +972 (9) 769-7129 (M) +972 (54) 995-0618 li-raz.rom@nice.commailto:li-raz.rom@nice.com www.nice.comhttp://www.nice.com/ [cid:image001.png@01CFECC5.3BFB6F80]http://twitter.com/NICE_Systems/ [cid:image002.png@01CFECC5.3BFB6F80] http://www.facebook.com/pages/NICE-Systems/149072782602/ [cid:image003.png@01CFECC5.3BFB6F80] http://www.linkedin.com/company/nice-systems [cid:image004.png@01CFECC5.3BFB6F80] http://www.nice.com/blog

[cid:image005.jpg@01CFECC5.3BFB6F80]http://www.nice.com/safecity

From: Narretz [mailto:notifications@github.com] Sent: יום ג, 21 אוקטובר 2014 00:21 To: angular/angular.js Cc: Li-raz Rom Subject: Re: [angular.js] When trying to present data on second window on IE - null is shown (#9694)

It works when you use .toString() in the scope assignment. Hmm.

— Reply to this email directly or view it on GitHubhttps://github.com/angular/angular.js/issues/9694#issuecomment-59841618.

Narretz commented 9 years ago

Sorry if that's an inconvenience to you, but it looks like a pretty easy, low-cost fix to me. You'll understand that such issues have very low priority.

gkalpak commented 9 years ago

Investigating this a little further, I came to the following conclusion:

The unexpected behaviour boils down to a call to toJson(xyz) (where xyz is the Date object referenced by testt.tt.aa). This in turn calls, JSON.stringify(xyz, toJsonReplacer, null);.

"Weird"(?) facts in IE:

Not sure if we could/want to somehow account for that.

UPDATE:

This doesn't seem specific to Date objects, but any object actually.