filter $scope Error: Unknown provider: $scopeProvider <- $scope <- transformSensorStatusFilter

后端 未结 2 1744
走了就别回头了
走了就别回头了 2021-02-18 22:32
marsApp.filter(\"transformSensorStatus\", function($scope) {
    return function(input, options) {

    var sensorReading = ( input ? ( input / 1000) : 0);
    var senso         


        
相关标签:
2条回答
  • 2021-02-18 22:47

    I found that "this" references local $scope (inside filter function.) Not sure if this is safe way of accessing it tho.

    0 讨论(0)
  • 2021-02-18 22:54

    The $scope is available only for controllers and the link function of directives. This is why the filter cannot find it. Maybe you meant $rootScope?

    0 讨论(0)
提交回复
热议问题