angular js: accessing $scope from jQuery

前端 未结 4 1507
伪装坚强ぢ
伪装坚强ぢ 2021-01-02 07:16

There are several questions like this in stackoverflow. I know. Tried all the answers, but still no luck. My html :

    
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 07:28

    Angular adds a global angular variable to your window.

    So you can do something like this:

    angular.element("#headline-game").scope().gameContent.headline;
    

提交回复
热议问题