Pass Angular scope variable to Javascript

后端 未结 4 1743
醉话见心
醉话见心 2020-11-27 03:20

I am having a Angular scope variable streetName.



        
4条回答
  •  天命终不由人
    2020-11-27 03:55

    I faced a similar problem. I found a work around. It worked well for me but not sure if it is the right approach.

    Create a hidden input field in the html and assign it your value from angular. Access this value in javascript. Make sure you create it before your script tag so that it will be initialized when you reach your script tag.

    Something like this:

    StreetName: {{streetName}}

提交回复
热议问题