Pass Angular scope variable to Javascript

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

I am having a Angular scope variable streetName.



        
4条回答
  •  遥遥无期
    2020-11-27 04:05

    Simple, non-complicated, jQuery solution:

    HTML

    Javascript

    $(document).ready(function() {
        var streetName = $('#data').data('street');
    });  
    

    The $(document).ready... is important to give angular time to set the variables.

提交回复
热议问题