Accessing $scope in AngularJS factory?

前端 未结 7 1239
我寻月下人不归
我寻月下人不归 2020-11-27 13:11

I am new to AngularJS and find it very interesting, but I am a bit unclear about the following situation.

app.factory(\'deleteFac\', function($http){

var fa         


        
7条回答
  •  旧巷少年郎
    2020-11-27 13:24

    The following trick is a very bad practice, but you can use it if you are in a hurry:

    Exchange the $scope with: angular.element('[ng-controller=CtrlName]').scope()

提交回复
热议问题