1

when I use Google Picker with Angular 2 everything seems ok but I get a cross-origin error every time. I work on locale with address http://localhost:5555. And i use jetty server, java at backend. Could someone tell me what to do and what I miss? I see the cross-origin problem is a general issue but I could not find a solution yet.

After a little search i find solution, i comes from css issue. picker object is created in body but not shown as modal. Solution:

.picker-dialog-bg {
    z-index: 20000 !important;
}

.picker-dialog {
    z-index: 20001 !important;
} 

.picker-dialog-content {
    position: relative;
}
erata
  • 88
  • 10
  • I see there is no comment yet. Maybe another approach solves my problem. Is there any sugestion about out of box script using google picker with angular 2, there is a module with angular 1 but i do not see for angular 2. – erata Oct 24 '17 at 14:11
  • i find the solution after a lot work. it stems from css issue. picker div is created in html body but not shown. so adding a few line css we can show it as modal. there were solutions for it, ( thanks to cs-NET and felipemarin https://stackoverflow.com/questions/23616810/show-google-picker-inside-over-modal, https://github.com/amsul/pickadate.js/issues/619) but they are missing, combining solutions it solve my problem:.picker-dialog-bg { z-index: 20000 !important; } .picker-dialog { z-index: 20001 !important; } – erata Oct 28 '17 at 12:52
  • Note: the 'cross-origin' alert occurs in console but drive picker runs after adding css files above – erata Nov 02 '17 at 16:53

0 Answers0